This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template < TerminalEnumType template_type > | |
| class Terminal : public JoeLang::Parser::Token | |
| { | |
| public: | |
| Terminal() = default; | |
| virtual ~Terminal() = default; | |
| static Terminal< template_type >* Parse( vector<Token*>::const_iterator& stream_begin, vector<Token*>::const_iterator stream_end ); | |
| static TokenEnumType m_tokenType = template_type; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <std::string literal, std::string name> | |
| std::unique_ptr< LiteralTerminal< literal, name > > LiteralTerminal::Parse( std::string::const_iterator& stream_begin, std::string::const_iterator stream_end ) | |
| { | |
| if( ( stream_end - stream_begin ) < literal.size() ) | |
| { | |
| if( std::equal( literal.begin(), literal.end(), stream_begin ) ) | |
| { | |
| stream_begin += literal.size(); | |
| return std::unique_ptr< LiteralTerminal< literal, name > >( new LiteralTerminal< literal, name > ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <std::string literal, std::string name> | |
| std::unique_ptr< LiteralTerminal< literal, name > > LiteralTerminal::Parse( std::string::const_iterator& stream_begin, std::string::const_iterator stream_end ) | |
| { | |
| if( ( end - begin ) < literal.size() ) | |
| { | |
| if( std::equal( literal.begin(), literal.end(), stream_begin ) ) | |
| { | |
| stream_begin += literal.size(); | |
| return std::unique_ptr< LiteralTerminal< literal, name > >( new LiteralTerminal< literal, name > ); | |
| } |