Exemplo n.º 1
0
        private Lexeme LexWithPossibleEquals(SyntaxCharacter withoutEquals, Operator withEquals)
        {
            int lexemeIndex = index;

            index++;

            if (Code.TryGet(index) == '=')
            {
                index++;
                return(new CharacterOperatorLexeme(withEquals, lineNumber, lexemeIndex));
            }
            else
            {
                return(new SyntaxCharacterLexeme(withoutEquals, lineNumber, lexemeIndex));
            }
        }
Exemplo n.º 2
0
 public SyntaxCharacterLexeme(SyntaxCharacter syntaxCharacter, int lineNumber, int index) : base(lineNumber, index)
 {
     SyntaxCharacter = syntaxCharacter;
 }
Exemplo n.º 3
0
 private Lexeme LexSpecificLexeme(SyntaxCharacter syntaxCharacter)
 {
     index++;
     return(new SyntaxCharacterLexeme(syntaxCharacter, lineNumber, index - 1));
 }