public final class ParseTreeFactory extends Object
public static IdentifierToken createIdentifierToken(String identifier)
public static Token createBooleanLiteralToken(boolean value)
public static Token createNullLiteralToken()
public static com.google.common.collect.ImmutableList<String> createEmptyParameters()
public static com.google.common.collect.ImmutableList<String> createParameters(IdentifierToken parameter)
public static com.google.common.collect.ImmutableList<String> createParameters(FormalParameterListTree parameters)
public static com.google.common.collect.ImmutableList<ParseTree> createStatementList(ParseTree... statements)
public static com.google.common.collect.ImmutableList<ParseTree> createStatementList(List<ParseTree> head, ParseTree tail)
public static FormalParameterListTree createParameterList(IdentifierToken parameter)
public static IdentifierExpressionTree createParameterReference(int index)
index
-th
parameter by its predefined name.PredefinedName.getParameterName(int)
public static FormalParameterListTree createParameterList(int numberOfParameters)
public static FormalParameterListTree createParameterListWithRestParams(int numberOfParameters)
public static FormalParameterListTree createParameterList(String... parameters)
public static FormalParameterListTree createEmptyParameterList()
public static ArgumentListTree createArgumentList(com.google.common.collect.ImmutableList<ParseTree> list)
public static ArgumentListTree createArgumentList(ParseTree... list)
public static ArgumentListTree createArgumentList(int numberOfArguments)
public static ArgumentListTree createArgumentListFromParameterList(FormalParameterListTree formalParameterList)
public static ArgumentListTree createEmptyArgumentList()
public static ArrayLiteralExpressionTree createArrayLiteralExpression(com.google.common.collect.ImmutableList<ParseTree> list)
public static ArrayLiteralExpressionTree createEmptyArrayLiteralExpression()
public static ArrayPatternTree createArrayPattern(com.google.common.collect.ImmutableList<ParseTree> list)
public static BinaryOperatorTree createAssignmentExpression(ParseTree lhs, ParseTree rhs)
public static BinaryOperatorTree createBinaryOperator(ParseTree left, Token operator, ParseTree right)
public static EmptyStatementTree createEmptyStatement()
public static BlockTree createEmptyBlock()
public static BlockTree createBlock(com.google.common.collect.ImmutableList<ParseTree> statements)
public static ParseTree createScopedStatements(com.google.common.collect.ImmutableList<ParseTree> statements)
public static CallExpressionTree createScopedExpression(BlockTree block)
public static CallExpressionTree createCallExpression(ParseTree operand, ArgumentListTree arguments)
public static CallExpressionTree createCallExpression(ParseTree operand)
public static CallExpressionTree createBoundCall(ParseTree function, ParseTree thisTree)
public static CallExpressionTree createLookupGetter(String aggregateName, String propertyName)
public static BreakStatementTree createBreakStatement()
public static CallExpressionTree createCallCall(ParseTree function, ParseTree thisExpression, ParseTree... arguments)
public static CallExpressionTree createCallCall(ParseTree function, ParseTree thisExpression, List<ParseTree> arguments)
public static ParseTree createCallCallStatement(ParseTree function, ParseTree thisExpression, ParseTree... arguments)
public static CaseClauseTree createCaseClause(ParseTree expression, com.google.common.collect.ImmutableList<ParseTree> statements)
public static CatchTree createCatch(IdentifierToken exceptionName, ParseTree catchBody)
public static ClassDeclarationTree createClassDeclaration(IdentifierToken name, ParseTree superClass, com.google.common.collect.ImmutableList<ParseTree> elements)
public static ClassDeclarationTree createClassExpression(IdentifierToken name, ParseTree superClass, com.google.common.collect.ImmutableList<ParseTree> elements)
public static CommaExpressionTree createCommaExpression(com.google.common.collect.ImmutableList<ParseTree> expressions)
public static ConditionalExpressionTree createConditionalExpression(ParseTree condition, ParseTree left, ParseTree right)
public static ContinueStatementTree createContinueStatement()
public static DefaultClauseTree createDefaultClause(com.google.common.collect.ImmutableList<ParseTree> statements)
public static DefaultParameterTree createDefaultParameter(IdentifierExpressionTree identifier, ParseTree expression)
public static DoWhileStatementTree createDoWhileStatement(ParseTree body, ParseTree condition)
public static ExpressionStatementTree createAssignmentStatement(ParseTree lhs, ParseTree rhs)
public static ExpressionStatementTree createCallStatement(ParseTree operand, ArgumentListTree arguments)
public static ExpressionStatementTree createCallStatement(ParseTree operand)
public static ExpressionStatementTree createExpressionStatement(ParseTree expression)
public static FinallyTree createFinally(ParseTree block)
public static ForOfStatementTree createForEachStatement(VariableDeclarationListTree initializer, ParseTree collection, ParseTree body)
public static ForInStatementTree createForInStatement(ParseTree initializer, ParseTree collection, ParseTree body)
public static ForStatementTree createForStatement(ParseTree variables, ParseTree condition, ParseTree increment, ParseTree body)
public static FunctionDeclarationTree createFunctionExpressionFormals(com.google.common.collect.ImmutableList<String> formalParameters, BlockTree functionBody)
public static FunctionDeclarationTree createFunctionExpression(FormalParameterListTree formalParameterList, BlockTree functionBody)
public static FunctionDeclarationTree createFunctionDeclaration(IdentifierToken name, FormalParameterListTree formalParameterList, BlockTree functionBody)
public static FunctionDeclarationTree createFunctionDeclaration(String name, FormalParameterListTree formalParameterList, BlockTree functionBody)
public static GetAccessorTree createGetAccessor(String propertyName, boolean isStatic, BlockTree body)
public static GetAccessorTree createGetAccessor(Token propertyName, boolean isStatic, BlockTree body)
public static IdentifierExpressionTree createIdentifierExpression(String identifier)
public static IdentifierExpressionTree createIdentifierExpression(IdentifierToken identifier)
public static IdentifierExpressionTree createUndefinedExpression()
public static IfStatementTree createIfStatement(ParseTree condition, ParseTree ifClause)
public static IfStatementTree createIfStatement(ParseTree condition, ParseTree ifClause, ParseTree elseClause)
public static LabelledStatementTree createLabelledStatement(IdentifierToken name, ParseTree statement)
public static ParseTree createBooleanLiteral(boolean value)
public static ParseTree createTrueLiteral()
public static ParseTree createFalseLiteral()
public static ParseTree createNullLiteral()
public static MemberExpressionTree createMemberExpression(IdentifierExpressionTree operand, String memberName, String... memberNames)
public static MemberExpressionTree createMemberExpression(String operandName, String memberName, String... memberNames)
public static MemberExpressionTree createMemberExpression(ParseTree operand, IdentifierToken memberName)
public static MemberExpressionTree createMemberExpression(ParseTree operand, String memberName)
public static MemberLookupExpressionTree createMemberLookupExpression(ParseTree operand, ParseTree memberExpression)
public static MemberExpressionTree createThisExpression(IdentifierToken memberName)
public static MemberExpressionTree createThisExpression(String memberName)
public static NewExpressionTree createNewExpression(ParseTree operand, ArgumentListTree arguments)
public static ObjectLiteralExpressionTree createObjectLiteralExpression(ParseTree... propertyNameAndValues)
public static ObjectLiteralExpressionTree createObjectLiteralExpression(com.google.common.collect.ImmutableList<ParseTree> propertyNameAndValues)
public static ObjectPatternTree createObjectPattern(com.google.common.collect.ImmutableList<ParseTree> list)
public static ObjectPatternFieldTree createObjectPatternField(IdentifierToken identifier, ParseTree element)
public static ParenExpressionTree createParenExpression(ParseTree expression)
public static PostfixExpressionTree createPostfixExpression(ParseTree operand, Token operator)
public static ProgramTree createProgramTree(com.google.common.collect.ImmutableList<ParseTree> sourceElements)
public static PropertyNameAssignmentTree createPropertyNameAssignment(String identifier, ParseTree value)
public static PropertyNameAssignmentTree createPropertyNameAssignment(Token propertyName, ParseTree value)
public static RestParameterTree createRestParameter(String identifier)
public static RestParameterTree createRestParameter(IdentifierToken identifier)
public static ReturnStatementTree createReturnStatement(ParseTree expression)
public static YieldExpressionTree createYieldStatement(ParseTree expression)
public static SetAccessorTree createSetAccessor(String propertyName, boolean isStatic, IdentifierToken parameter, BlockTree body)
public static SetAccessorTree createSetAccessor(String propertyName, boolean isStatic, String parameter, BlockTree body)
public static SetAccessorTree createSetAccessor(Token propertyName, boolean isStatic, IdentifierToken parameter, BlockTree body)
public static SpreadExpressionTree createSpreadExpression(ParseTree expression)
public static SpreadPatternElementTree createSpreadPatternElement(ParseTree lvalue)
public static SwitchStatementTree createSwitchStatement(ParseTree expression, com.google.common.collect.ImmutableList<ParseTree> caseClauses)
public static ThisExpressionTree createThisExpression()
public static ThrowStatementTree createThrowStatement(ParseTree value)
public static TryStatementTree createTryFinallyStatement(ParseTree body, ParseTree finallyBlock)
public static TryStatementTree createTryStatement(ParseTree body, ParseTree catchBlock, ParseTree finallyBlock)
public static UnaryExpressionTree createUnaryExpression(Token operator, ParseTree operand)
public static VariableDeclarationListTree createVariableDeclarationList(TokenType binding, IdentifierToken identifier, ParseTree initializer)
public static VariableDeclarationListTree createVariableDeclarationList(TokenType binding, String identifier, ParseTree initializer)
public static VariableDeclarationListTree createVariableDeclarationList(TokenType binding, com.google.common.collect.ImmutableList<VariableDeclarationTree> declarations)
public static VariableDeclarationTree createVariableDeclaration(String identifier, ParseTree initializer)
public static VariableDeclarationTree createVariableDeclaration(ParseTree lvalue, ParseTree initializer)
public static VariableDeclarationTree createVariableDeclaration(IdentifierToken name, ParseTree initializer)
public static VariableStatementTree createVariableStatement(TokenType binding, IdentifierToken identifier, ParseTree initializer)
public static VariableStatementTree createVariableStatement(TokenType binding, String identifier, ParseTree initializer)
public static VariableStatementTree createVariableStatement(VariableDeclarationListTree list)
public static WhileStatementTree createWhileStatement(ParseTree condition, ParseTree body)
public static WithStatementTree createWithStatement(ParseTree expression, ParseTree body)
public static ExpressionStatementTree createAssignStateStatement(int state)
Copyright © 2009-2014 Google. All Rights Reserved.