public IdentifierAST ParseIdentifier() { if (Tok() != TokenType.String && Tok() != TokenType.QuotedString) throw new Exception(GetErrorMsg()); var ast = new IdentifierAST(); ast.value = Inc(); return ast; }
private AST ParseIdentifierRef(List <string> ns) { if (ns != null && !ns.Contains(_lexer.CurrentToken.Value)) { throw new Exception($"Parameter {_lexer.CurrentToken.Value} is not defined"); } var node = new IdentifierAST(_lexer.CurrentToken.Value); _lexer.AcceptToken(TokenType.Identifier); return(node); }
public static PBXElementString ParseIdentifierAST(IdentifierAST ast, TokenList tokens, string text) { Token tok = tokens[ast.value]; string value; switch (tok.type) { case TokenType.String: value = text.Substring(tok.begin, tok.end - tok.begin); return(new PBXElementString(value)); case TokenType.QuotedString: value = text.Substring(tok.begin, tok.end - tok.begin); value = PBXStream.UnquoteString(value); return(new PBXElementString(value)); default: throw new Exception("Internal parser error"); } }
public object DoForIdentifier(IdentifierAST id, object options = null) { Console.WriteLine("(IdentifierAST)" + id.token.value); return(options); }
public object DoForIdentifier(IdentifierAST id, object options = null) { PositionOutput(id.token.indent); ConsoleEx.WriteLine("{0}(IdentifierAST) {1}{2}", ConsoleColor.DarkBlue, ConsoleColor.Gray, id.token.value); return(options); }