/// <summary> /// Returns true if name is a C# keyword /// </summary> public TokenType IsKeyword(Name name) { object o = _keywords[name]; if (o != null) { return (TokenType)o; } return TokenType.Invalid; }
public PreprocessorTokenType IsKeyword(Name value) { object o = keywords[value]; if (o != null) { return (PreprocessorTokenType)o; } return PreprocessorTokenType.Invalid; }
/// <summary> /// Creates or returns the Name for a string. /// </summary> public Name Add(string value) { Name name = Find(value); if (name == null) { name = new Name(value); _values.Add(name, name); } return name; }
public Parser(NameTable symbolTable, string path) { this.symbolTable = symbolTable; _path = path; assemblyName = symbolTable.Add("assembly"); moduleName = symbolTable.Add("module"); unknownName = symbolTable.Add("__unknown"); getName = symbolTable.Add("get"); setName = symbolTable.Add("set"); addName = symbolTable.Add("add"); removeName = symbolTable.Add("remove"); partialName = symbolTable.Add("partial"); yieldName = symbolTable.Add("yield"); whereName = symbolTable.Add("where"); aliasName = symbolTable.Add("alias"); }
internal IdentifierToken(Name identifier, bool atPrefixed, string sourcePath, BufferPosition position) : base(TokenType.Identifier, sourcePath, position) { _symbol = identifier; _atPrefixed = atPrefixed; }
public PreprocessorIdentifierToken(Name value, BufferPosition position) : base(PreprocessorTokenType.Identifier, position) { _value = value; }
private IdentifierToken EatContextualKeyword(Name contextualKeyword) { IdentifierToken token = (IdentifierToken)Eat(TokenType.Identifier); Debug.Assert(token.Symbol == contextualKeyword); return token; }
private bool PeekContextualKeyword(Name contextualKeyword) { return PeekType() == TokenType.Identifier && ((IdentifierToken)PeekToken()).Symbol == contextualKeyword; }
public PreprocessorDeclarationLine(PreprocessorTokenType type, Name identifier) : base(type) { _identifier = identifier; }