Package gw.internal.gosu.parser
Class GosuParser
java.lang.Object
gw.internal.gosu.parser.ParserBase
gw.internal.gosu.parser.GosuParser
- All Implemented Interfaces:
IGosuParser,IParserPart
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classNested classes/interfaces inherited from interface gw.lang.parser.IGosuParser
IGosuParser.ParseType, IGosuParser.Settings -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate Booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate ContextInferenceManagerprivate Map<String,List<IFunctionSymbol>> private intprivate intprivate intprivate Stack<TypeVarToTypeMap>private Stack<ContextType>(package private) intprivate intprivate booleanprivate ArrayList<VarStatement>private ArrayList<FunctionType>private booleanprivate Programprivate IScriptabilityModifierprivate Stack<IScriptPartId>private Stack<ParsedElement>private Stack<DynamicFunctionSymbol>private Stringprivate ISymbolTableprivate SourceCodeTokenizerprivate ITokenizerInstructorprivate ITypeUsesMapprivate HashMap<String,ITypeVariableDefinition> private static final String[]Using some simple pattern matching, get a potential property name from a method name at the end of an access list.private static final String[]static ErrorTypestatic final ITypeFields inherited from class gw.internal.gosu.parser.ParserBase
_bDontOptimizeStatementLists, _blocks, _offsetShiftFields inherited from interface gw.lang.parser.IGosuParser
BIGD_ZERO, DOUBLE_DIGITS, NaN, ONE, ZERO -
Constructor Summary
ConstructorsConstructorDescriptionGosuParser(ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint) GosuParser(ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint, ITypeUsesMap tuMap) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean_areParametersEquivalent(IDynamicFunctionSymbol dfs1, IDynamicFunctionSymbol dfs2, IType[] args, IType[] toArgs) private void_doParseObjectInitializer(IType objectType) private void_parseAnonymousInnerClass(IType declaringClass, IGosuClassInternal gsDeclaringClass, ICompilableTypeInternal enclosingType, int iNameOffset, NewExpression newExpr, int mark) (package private) void(package private) voidprivate void(package private) boolean_parseIndirectMemberAccess(boolean bParseTypeLiteralOnly) private void(package private) void(package private) void_parseLiteral(Token token) (package private) boolean_parseNameOrMethodCall(Token token) (package private) void_parseNewExpressionOrAnnotation(boolean bAnnotation, boolean bBacktracking) private boolean_parseObjectInitializer(IType objectType) (package private) boolean_parsePrimaryExpression(Token token) (package private) boolean(package private) void_parseStatements(boolean isolatedScope) private void_parseStringLiteral(boolean bUnterminatedLiteral, Token t) (package private) boolean_parseTypeLiteral(Token token, boolean bIgnoreArrayBrackets, boolean bInterface) (package private) boolean_parseTypeLiteralWithAggregateSyntax(Token token, boolean bIgnoreArrayBrackets, boolean bInterface) (package private) boolean_parseTypeVariableDefinition(ParsedElement parsedElem, TypeVariableDefinition typeVarDef, boolean bFirstPass) (package private) voidprivate voidaddAllNonstaticPrivateMethods(String name, IGosuClassInternal superClass, List<IFunctionSymbol> functions) private voidaddDefaultReturnStmt(DynamicFunctionSymbol dfsDecl, StatementList stmtList) private voidaddJavaPropertyMethods(String strMemberName, IType rootType, List<IFunctionType> listFunctionTypes) (package private) voidaddMisingArgsWithDefaultValues(ParsedElement element, IInvocableType funcType, List<Expression> argExpressions, List<LightweightParserState> parserStates, boolean bShouldScoreMethods) (package private) voidaddNameInDeclaration(String strName, int iOffsetName, int iLineNumName, int iColumnName, boolean bHasName) private voidaddToCompoundType(List<IType> types) private voidaddTypeVarsToList(List<IType> typeVariableTypes, IGenericTypeVariable[] typeVariables) private booleanallTypeLiterals(List<IExpression> args) private booleanappliesToElementType(IGosuAnnotation anno, ElementType elemType) private booleanareDFSsInSameNameSpace(IDynamicSymbol newDfs, IDynamicSymbol existingDfs) private booleanareMetaTypes(IType lhsType, IType rhsType) private booleanareParametersEquivalent(IDynamicFunctionSymbol dfs, IDynamicFunctionSymbol dfsExisting, IType... extraParams) private booleanprivate booleanassignArgExprPosition(List<? extends IInvocableType> listFunctionTypes, int iArgs, List<Integer> namedArgOrder, int iArgPos) (package private) static DynamicFunctionSymbolassignPossibleDuplicateDfs(DynamicFunctionSymbol dfsDecl, Iterable symbols) private voidassignRuntime(ParsedElement elem, boolean bIsolatedScope, IFileContext context, IType superType, IScriptPartId partId) private boolean(package private) voidbacktrack(int mark, int iLocationsCount) (package private) voidbacktrack(int mark, int iLocationsCount, Expression expr) private voidbacktrackArgParsing(int mark, int iLocationsCount, List<Expression> argExpressions) private ExpressionbacktrackBinderExpr(int locationsCount, Expression primExpr) private ITypeboundCtxType(IType ctxType) private ITypeboundCtxType(IType ctxType, boolean bKeepTypeVars) private IFunctionTypeboundFunctionType(IFunctionType funcType) private voidprivate ExpressionbuildRhsOfCompoundOperator(Expression lhs, String assignOp, Expression rhs) private booleancanCoerceFromString(Expression first, Expression second) private booleancheckComparableAndCastable(Expression lhs, Expression rhs) private voidcheckForStaticMethod(IType classBean, Expression[] eArgs, String strMethod, GosuParser parserState) (package private) voidcheckInstruction(boolean bProcessDirectives) private voidprivate voidprotected voidprivate voidprivate voidconvertNullLiterals(IType contextType) private voidconvertNumberLiteralsToContextType(IType contextType) private voidprivate voidbooleandoParametersReifyToSameBytecodeType(IDynamicFunctionSymbol dfs, IDynamicFunctionSymbol dfsExisting) (package private) booleandoTypesReifyToTheSameBytecodeType(IType toArg, IType arg) private Expressionprivate Expressionprivate Expressionprivate booleanerrorsSame(List<IParseIssue> newErrors, List<IParseIssue> errors) evalTypes(List<IExpression> arguments) extractContextTypes(List<? extends IInvocableType> funcTypes) private List<MethodScore>factorInParseErrors(List<MethodScore> scoredMethods) private DynamicFunctionSymbolfindCorrespondingDeclDfs(int iOffsetName, int iModifiers) private IFunctionTypefindFunction(List<IFunctionType> listFunctionTypes, boolean bNoArgsProvided) static ITypeprivate MethodScorefindLeastParams(List<MethodScore> scoredMethods) Param count is the tiebreaker when vararg methods are involved.private ITypefindLeastUpperBoundWithCoercions(ConditionalTernaryExpression cte, Expression first, Expression second) private DynamicFunctionSymbolfindProgramPropertyDfs(String strFunctionName, ArrayList<ISymbol> args) private List<IAttributedFeatureInfo>getAllStaticFeatures(IGosuClass gsType, String name) private ITypegetBlockReturnType(IParsedElement blockBody, IType ctxType) private IConstructorInfogetConstructor(IType instanceClass) getConstructorType(IType classBean, Expression[] eArgs, List<IConstructorType> listAllMatchingMethods, ParserBase parserState) Get the type of the method specified in the member path.private ContextTypeprivate ExpressiongetDefaultValueOrPlaceHolderForParam(int iParam, IInvocableType invType) protected List<IFunctionSymbol>getDfsDeclsForFunction(String strFunctionName) private IDynamicFunctionSymbolgetDFSForFunctionType(String strFunction, MethodScore bestMethod) private ITypeprivate Map<String,TypeVariableDefinition> getFunctionType(IType classBean, String functionName, Expression[] eArgs, List<IFunctionType> listAllMatchingMethods, GosuParser parser, boolean bMatchParamTypes) protected List<IFunctionType>getFunctionTypesForName(String strFunctionName) private GosuConstructorInfogetGsConstructorInfo(IConstructorInfo ci, IGosuClassInternal gsInstanceClass) private IConstructorInfogetImplicitConstructor(IType type) private ContextTypeprivate ITypegetInnerClass(String strMemberName, IType memberType, IHasInnerClass typeLiteralType) private StatementgetLastStatement(Statement statement) private StringgetModifierString(IConstructorType constructorType) private ITypegetNumberTypeFromContextType(IType ctxType) private ITypegetNumericTypeFrom(String strValue) (package private) DynamicPropertySymbolgetOrCreateDynamicPropertySymbol(ParsedElement parsedElement, IGosuClassInternal gsClass, DynamicFunctionSymbol dfs, boolean bGetter) private IGosuClassprivate ITypegetParamTypeFromParamName(IInvocableType invType, String strParam, int[] iPos) private IType[]getParamTypes(List<Expression> argExpressions) private ArrayList<IConstructorType>getPreliminaryConstructorTypes(IType declaringClass, NewExpression e) private List<IFunctionType>getPreliminaryFunctionTypes(String strMemberName, BeanMethodCallExpression e, IType rootType, IType[] typeParameters) private DynamicFunctionSymbolprivate StringgetPropertyNameFromMethodName(String strMethod) private StringgetPropertyNameFromMethodName(String strPrefix, String strMethod) private Stringprotected StringThe context associated with the parser's script.getState()private intReturns the parser's symbol table.final SourceCodeTokenizerThe TokenizerInstructor to use for this parser.getTypes(List<? extends IExpression> list) Get the type uses map.private ITypeVariableDefinitiongetTypeVarDef(String strTypeName) private List<TypeVariableDefinitionImpl>getTypeVarDefsFromDecl(IGenericTypeVariable[] typeVars) private voidhandleAbstractCtor(int iTokenStart, String strMemberName, BeanMethodCallExpression e, IParserState state) private StatementListprivate voidhandleImplicitCoercionsInArgs(ParsedElement element, IType[] argTypes, IType[] rawArgTypes, List<Expression> args) private booleanhasContextSensitiveExpression(List<Expression> argExpressions) private static booleanprivate static booleanhasMethod_Cached(IType type, String method) private booleanhasParseExceptions(Expression expr) private booleanhasSemicolon(IParsedElement stmt) private booleanhasTypeModifier(String strValue) booleanprivate booleanprivate voidprivate ITypeinferArgType(IType contextType, TypeVarToTypeMap inferenceMap) private IInvocableTypeinferConstructor(ConstructorType ctorType, TypeVarToTypeMap inferenceMap) private IInvocableTypeinferFunction(IInvocableType funcType, List<? extends IExpression> eArgs, boolean bUseCtx, TypeVarToTypeMap inferenceMap) private IInvocableTypeinferFunctionType(IInvocableType funcType, List<? extends IExpression> eArgs, boolean bUseCtx, TypeVarToTypeMap inferenceMap) private voidinferFunctionTypeVariables(IType rawContextType, IType boundContextType, Expression expression, TypeVarToTypeMap inferenceMap) private ITypeinferReturnTypeForBlockArgument(ContextType contextType, IType[] unbound) booleanprivate booleanisAnnotation(IType type) private booleanisAssignableFrom(IType type1, IType type2) private booleanisBinLiteral(String num) private booleanisBlockInvoke(Expression rootExpression, String strMemberName, IType rootType) private booleanisBlockSym(ISymbol functionSymbol) booleanprivate booleanprivate booleanprivate booleanisConditional(IExpression expression) private booleanisConnectorStringValid(boolean bPostfix, String connectorString, Expression unitExpr, IType unitBinderType) private booleanisConstructingNonStaticInnerClassFromNonStaticContext(IType innersEnclosingClass, IGosuClassInternal constructingFromClass) (package private) booleanisDeclarationKeyword(String strKeyword) private booleanisDynamicMethod(List<? extends IInvocableType> listFunctionTypes) booleanprivate booleanprivate booleanprivate booleanprivate booleanisErrorType(IType rootType) private booleanbooleanprivate booleanprivate booleanisHexLiteral(String num) booleanprivate booleanisInitializableType(IType type) private booleanprivate booleanisIsolatedCase(List<CaseClause> cases) private booleanprivate booleanisNonStaticInnerClassConstructableFromCurrentFunction(IType innersEnclosingClass, IGosuClassInternal constructingFromClass) private booleanisOpenParenOnNextLine(int mark) private booleanprivate booleanisParenthesisTerminalExpression(boolean bMatchOpeningParen) booleanisParsed()booleanbooleanprivate booleanprivate booleanbooleanboolean(package private) booleanprivate booleanbooleanprivate booleanprivate booleanisPrefixNumericLiteral(String strValue) private booleanprivate booleanprivate booleanisSuperCall(Expression rootExpression, Expression indexExpression) private booleanisSymbolInScopeDirectly(ISymbol idSym) private booleanisTerminal(Statement statement, IType returnType) private booleanisThisPointer(Expression expr) booleanprivate booleanisTypeParameterErrorMsg(Expression expr, List<IParseIssue> exceptions) private booleanisTypeParamHeaderCompiling(IType typeParam) private booleanisUnexpectedToken(Statement statement) private booleanisValidAnnotationMethodReturnType(IType returnType) private MethodScoremakeDynamicMethodScore(List<? extends IInvocableType> listFunctionTypes, List<Expression> argExpressions) private DynamicPropertySymbolmakeGetter(VarStatement varStmt, String strVarIdentifier, String strPropertyName, IType varType, ModifierInfo modifiers, ISymbol symbol, ICompilableType gsClass, boolean bOldSyntax) (package private) DynamicPropertySymbolmakeProperties(VarStatement varStmt, String strVarIdentifier, String strPropertyName, IType varType, ModifierInfo modifiers, boolean bGetter, boolean bSetter) private DynamicPropertySymbolmakeSetter(VarStatement varStmt, String strVarIdentifier, String strPropertyName, IType varType, ModifierInfo modifiers, ISymbol symbol, ICompilableType gsClass, DynamicPropertySymbol dps, boolean bOldSyntax) private voidmakeTypeParameterListClause(int iOffset, int iLineNum, int iColumn, List<TypeLiteral> paramTypes) private TypeVarToTypeMapprivate Stringprivate boolean(package private) booleanmatchPrimitiveType(boolean bSuperThis) private booleanprivate Stringprivate List<IFunctionSymbol>maybeAddPrivateFunctionsIfSuperInSamePackage(String name, List<IFunctionSymbol> functions) (package private) booleanprivate List<? extends IInvocableType>maybeAvoidNestedMethodScoring(List<? extends IInvocableType> listFunctionTypes) private IInvocableTypemaybeBoundFunctionTypeVars(IInvocableType inferredFunctionType, TypeVarToTypeMap inferenceMap) private ISymbolmaybeCaptureSymbol(MethodCallExpression e, ISymbol functionSymbol) private ITypemaybeChangeToInferredType(IType declaringClass, TypeLiteral typeLiteral, MethodScore bestConst) (package private) booleanmaybeEatNonDeclKeyword(boolean bHasName, String strFunctionName) private IPropertyInfomaybeGetProxiedPropertyInfo(String propName, IPropertyInfo pi) private voidmaybeInferFunctionTypeVarsFromReturnType(IInvocableType invType, TypeVarToTypeMap inferenceMap) private TypeLiteralprivate voidmaybeOpenParenIsForParenthesizedExpr(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty, BeanMethodCallExpression e, IType rootType, boolean bExpansion, IType[] typeParameters, int iParenStart, int mark, int iLocationsCount) private IFunctionTypemaybeParameterizeOnCtxType(IFunctionType funcType) private voidmaybeParseIdentifierAssumingOpenParenIsForParenthesizedExpr(String[] t, int iOffset, int iLineNum, int iColumn, IParserState state, MethodCallExpression e, IType[] typeParameters, String strFunction, ISymbol functionSymbol, int mark, int iLocationsCount) private voidmaybeParseImpliedStaticMethod(int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, String strFunction, int markBeforeTypeArgs, int iLocBeforeTypeArgs) private booleanmaybeParseImpliedThisMethod(int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, String strFunction, int markBeforeTypeArgs, int iLocBeforeTypeArgs) private voidmaybeReassignOffsetForArgumentListClause(int iArgs, List<Expression> argExpressions, int iOffset, int iLineNum, int iColumn) private voidprivate List<? extends IInvocableType>maybeRemoveNonGenericMethods(List<? extends IInvocableType> listFunctionTypes, IType[] typeParams) private booleanmaybeReparseWithoutContextType(int mark, int iLocationsCount, Expression initializerExpression) private booleanmaybeReplaceErrantPackageExprWithEnumConstEpr(int iOffset, int iLineNum, int iColumn, Expression expr) private voidmaybeReplacePackageExprWithTypeLiteral(int iOffset, int iLineNum, int iColumn, Expression expr) private ITypeprivate voidprivate StringmaybeStripTypeModifier(String strValue, IType numericTypeFrom) private voidmaybeVerifyDoubleLiteral(IExpression oneSide, IExpression otherSide) private voidprotected voidintnextIndexOfErrantDuplicateDynamicSymbol(IDynamicSymbol ds, Collection<? extends ISymbol> symbols, boolean bCheckContains) private ArrayList<IFunctionType>parameterizeFunctionTypes(Expression expression, IType[] typeParameters, List<IFunctionType> listFunctionTypes) (package private) voidprivate voidparseAggregateTypeLiteral(boolean bInterface) private ITypeparseAnonymousInnerClass(IType declaringClass, TypeLiteral typeLiteral, NewExpression newExpr, int state, int mark) private intparseArgExpression(IInvocableType funcType, int iArgs, List<Expression> argExpressions, TypeVarToTypeMap inferenceMap, List<LightweightParserState> parserStates, Set<String> namedArgs, boolean bMethodScoring) private MethodScoreparseArgumentList(IType rootType, ParsedElement element, List<? extends IInvocableType> listFunctionTypes, IType[] typeParams, boolean bVerifyArgs, boolean bNoArgsProvided) private boolean(package private) List<Expression>parseArrayValueList(IType componentType) private voidprivate voidparseAssignment(Expression e, String assignOp) (package private) booleanprivate ExpressionparseAssignmentRhs(String operation, IType typeExpected, Expression lhs) (package private) FunctionStatementparseBaseFunctionDefinition(FunctionStatement functionStmt, boolean bProperty, boolean bGetter, ModifierInfo modifiers) (package private) void(package private) voidparseBindableExpression(boolean bPostfix) private voidparseBindableExpression(Token token) private voidparseBindableExpression(Token token, boolean bPostfix) private voidparseBindingExpression(Token token) private voidparseBindingExpression(Token token, boolean bPostfix) (package private) void(package private) void(package private) void(package private) voidprivate void(package private) voidprivate booleanparseBooleanLiteral(Token token) (package private) booleanparseCaseClause(SwitchStatement switchStmt, List<CaseClause> cases) (package private) voidparseCaseClauses(SwitchStatement switchStmt) private booleanparseCharLiteral(Token token) parseClass(String strQualifiedClassName, ISourceFileHandle sourceFile, boolean bThrowOnWarnings, boolean bFullyCompile) For use by code editors etc.private voidprivate voidparseCompoundTypeLiteralExpression(String[] T, boolean bInterface, int iOffset, int iLineNum, int iColumn) (package private) void(package private) void(package private) void(package private) booleanparseDefaultClause(SwitchStatement switchStmt, List<CaseClause> cases) (package private) voidparseDelegateStatement(DelegateStatement delegateStmt, String strIdentifier) private voidparseDirective(boolean processDirectives) private NumericLiteralparseDouble(String strValue) private NumericLiteralparseDoubleOrBigDec(String strValue) private voidprivate voidparseDynamicFunction(Symbol dynamcSymbol) private voidprivate voidprivate voidparseExp(IScriptPartId partId) Parses a Gosu expression.private ExpressionparseExp(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType, boolean assignRuntime) private ExpressionparseExp(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType, IFileContext context, boolean assignRuntime) parseExp(IScriptPartId partId, IType expectedExpressionType) Parses a Gosu expression.parseExp(IScriptPartId partId, IType expectedExpressionType, IFileContext context, boolean assignRuntime) Parses a Gosu expression.private voidparseExplicitlyTypedNumericLiteral(String strValue, IType numericTypeFrom) parseExpOrProgram(IScriptPartId partId) Parses a Gosu expression.parseExpOrProgram(IScriptPartId partId, boolean isolatedScope, boolean assignRuntime) Parses a Gosu expression.parseExpOrProgram(IScriptPartId partId, IType typeExpected, boolean isolatedScope, boolean assignRuntime) (package private) void(package private) voidparseExpression(ContextType contextType) (package private) voidparseExpression(ContextType ctxType, boolean bVerify) (package private) voidparseExpressionNoVerify(ContextType ctxType) private booleanparseFeatureLiteral(Token token, Expression root) private NumericLiteralparseFloat(String strValue) private voidprivate booleanparseFunctionBody(FunctionStatement functionStmt, FunctionType type) (package private) DynamicFunctionSymbolparseFunctionDecl(ParsedElement element, boolean bProperty, boolean bGetter, ModifierInfo modifiers) (package private) DynamicFunctionSymbolparseFunctionDecl(ParsedElement element, ModifierInfo modifiers) (package private) DynamicFunctionSymbolparseFunctionDecl(ParsedElement element, String T, boolean bProperty, boolean bGetter, ModifierInfo modifiers) (package private) boolean(package private) ISymbolprivate IType[]private voidparseIdentifier(Identifier e, String[] T) private voidparseIdentifier(String[] T) private voidparseIdentifierOrTypeLiteralOrEnumConstant(String[] T, int iOffset, int iLineNum, int iColumn) private voidprivate voidparseIndexVar(ForEachStatement forEachStmt) private voidparseIndirectMemberAccess(int iOffset, int iLineNum, int iColumn) private voidparseIndirectMemberAccess(int iOffset, int iLineNum, int iColumn, boolean bParsingTypeLiteralOnly) private booleanparseInitializerAssignment(IType objectType) private voidparseInitializerIdentifier(IType objectType) (package private) voidprivate NumericLiteralparseIntOrLongOrBigInt(String strValue) private voidparseIteratorVar(ForEachStatement forEachStmt, IType type) (package private) voidparseLiteral(Token token) private List<IGosuAnnotation>parseLocalAnnotations(List<IGosuAnnotation> annotations) (package private) voidparseLocalVarStatement(VarStatement varStmt) (package private) booleanprivate voidprivate voidparseMemberAccess(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly) private voidparseMemberAccess(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty) private voidparseMethodCall(String[] t, int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, MethodCallExpression e, IType[] typeParameters, String strFunction, ISymbol functionSymbol, int markBeforeTypeArgs, int iLocBeforeTypeArgs, int markAfterTypeArgs) private voidparseMethodCall(String[] t, IParserState state, MethodCallExpression e, IType[] typeParameters, String strFunction, ISymbol functionSymbol) private voidparseMethodMember(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty, BeanMethodCallExpression e, IType rootType, boolean bExpansion, IType[] typeParameters, int iParenStart, int mark) private voidparseMethodMember(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, BeanMethodCallExpression e, IType rootType, boolean bExpansion, IType[] typeParameters, int iParenStart) (package private) voidprivate intparseNamedParamExpression(IInvocableType invType, boolean bMethodScoring) private void(package private) booleanparseNameOrMethodCall(Token token) private voidparseNamespaceStartOrRelativeType(String[] T, boolean bInterface) (package private) void(package private) void(package private) void(package private) voidnew-expression new <type-expression> ( [<argument-list>] ) { [<initialization-expression>] } new <type-expression> [ <expression> ] new <type-expression> [] { [<array-value-list>] }(package private) voidparseNewExpressionOrAnnotation(boolean bAnnotation) (package private) voidparseNewExpressionOrAnnotation(IType declaringClass, boolean bAnnotation, boolean bNoArgNoParenthesis, TypeLiteral typeLiteral, int mark) private booleanparseNullLiteral(Token token) private booleanparseNumberLiteral(Token token) private booleanparseNumberLiteral(Token token, boolean negated) private voidparseNumericValue(String strValue) private booleanparseObjectInitializer(IType objectType) parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes) parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes, boolean bProperty, boolean bGetter, boolean bEmpty, boolean bVarDynamicArg) (package private) booleanparseParameterType(IType boundingType) private voidparsePlainFunction(IFunctionSymbol functionSymbol) private IType[]private voidparsePostfixNumericLiteral(String num, IType numericTypeFrom, int radix) private booleanparsePostfixUnitBindingExpression(Token priorToken, String connectorString) private voidparsePrefixNumericLiteral(String strValue, IType numericTypeFrom) private booleanparsePrefixUnitBindingExpression(Token priorToken, String connectorString) (package private) voidparseProgram(IScriptPartId partId) parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException) parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException, IType superType) parseProgram(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType) parseProgram(IScriptPartId partId, IType expectedExpressionType) parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException) (package private) List<IClasspathStatement>(package private) FunctionStatementprivate voidprivate boolean(package private) List<ITypeLoaderStatement>(package private) booleanprivate voidparsePropertyMember(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty, IType rootType, boolean bExpansion) (package private) voidprivate booleanparseRelativeFeatureLiteral(Token token) private voidprivate booleanprivate booleanparseStandAloneDataStructureInitialization(Token token, boolean bAvoidContextType, boolean bBacktracking) (package private) boolean(package private) booleanparseStatement(boolean bAsStmtBlock) (package private) booleanparseStatement(boolean forceKeepStmtBlock, boolean bAsStmtBlock) private voidprivate voidparseStatementBlock(boolean bMatchClosingBrace) private voidparseStatementBlock(boolean forceKeepStmtBlock, boolean bMatchClosingBrace) parseStatements(IScriptPartId partId) Parses a set of Gosu statements.private StatementparseStatements(IScriptPartId partId, boolean verify, boolean isolatedScope) (package private) voidparseStatementsAndDetectUnreachable(List<Statement> statements) private booleanparseStringLiteral(Token token) private booleanprivate voidprivate TemplateStringLiteralprivate voidprivate void(package private) voidbooleanConsumes a type literal from the current tokenizer, if one exists.(package private) booleanparseTypeLiteral(boolean bInterface) booleanparseTypeLiteral(Token token) (package private) booleanparseTypeLiteral(Token token, boolean bInterface) parseTypeLiteral(IScriptPartId partId) Parses a type literal expression.(package private) voidparseTypeLiteral(String[] T, boolean bIgnoreArrayBrackets, boolean bInterface, int iOffset, int iLineNum, int iColumn) (package private) void(package private) List<TypeLiteral>parseTypeParameters(IType enclosingType) (package private) voidparseTypeVariableDefinition(ParsedElement parsedElem, TypeVariableDefinition typeVarDef, boolean bFirstPass) (package private) List<ITypeVariableDefinitionExpression>parseTypeVariableDefList(ParsedElement parsedElem, boolean bForFunction, List<TypeVariableDefinitionImpl> typeVarDefListFromDecl) (package private) List<ITypeVariableDefinitionExpression>parseTypeVariableDefs(ParsedElement parsedElem, boolean bFunction, List<TypeVariableDefinitionImpl> typeVarDefListFromDecl) (package private) void(package private) voidprivate booleanprivate booleanparseUnitExpressionFactor(Token token) private MemberAccessparseUnqualifiedEnumConstant(String strConstValue) (package private) void(package private) voidparseUsesStatement(boolean bResolveTypes) parseUsesStatementList(boolean bResolveUsesTypes) private voidprivate voidparseVariance(ParsedElement parsedElem, TypeVariableDefinition typeVarDef) (package private) DynamicPropertySymbolparseVarPropertyClause(VarStatement varStmt, ModifierInfo modifiers, String strVarIdentifier, IType varType, boolean parseInitializer) (package private) voidparseVarStatement(VarStatement varStmt, Token idToken, boolean bClassMember) private voidparseVarStatementsInUsingStatement(UsingStatement usingStmt) private voidprivate booleanprotected DynamicFunctionSymbolprotected Expressionprotected ParsedElement(package private) Programprotected Statementprotected DynamicFunctionSymbolvoid(package private) voidpopInferenceMap(TypeVarToTypeMap inferenceMap) voidvoid(package private) VarStatement(package private) FunctionTypevoid(package private) voidpopScriptPart(IScriptPartId partId) protected Statementprivate StatementpopStatementAndDetectUnreachable(Statement previousStatement, List<Statement> statements) private ISymbolpossiblyResolveFunctionSymbol(MethodCallExpression e, String strFunction) private voidprocessUsesStatement(UsesStatement usesStmt, TypeLiteral typeLiteral, IFeatureInfo fi, IGosuClass gsType) private voidprocessUsesStatementFeatureLiteral(boolean bResolveTypes, UsesStatement usesStmt, TypeLiteral typeLiteral, FeatureLiteral fl) private voidprocessUsesStatementTypeLiteral(boolean bResolveTypes, UsesStatement usesStmt, TypeLiteral typeLiteral) private booleanpropertyTypeDiffers(DynamicFunctionSymbol dfs, DynamicFunctionSymbol dfsExisting) protected voidprivate voidpushErrorNumberLiteral(ResourceKey key, Object... args) protected voidvoidvoidpushInferenceMap(TypeVarToTypeMap inferenceMap) voidpushInferredContextTypes(ContextType ctxType) voidpushParsingAbstractConstructor(Boolean bParsingAbstractConstructor) (package private) voidpushParsingFieldInitializer(VarStatement VarStatement) (package private) voidpushParsingFunction(FunctionType functionType) voidpushParsingStaticMember(Boolean bParsingStaticFeature) voidpushScriptPart(IScriptPartId partId) protected voidpushStatement(Statement stmt) protected voidpushTypeVariableTypesToInfer(IInvocableType functionType) voidvoidputDfsDeclsInTable(ISymbolTable table) private voidputThisAndSuperSymbols(ModifierInfo modifiers) private booleanprivate voidprivate voidremoveLocation(ParseTree location) (package private) voidremoveLocationsFrom(int iLocationsCount) private MethodScorereparseArguments(MethodScore bestScore, List<Expression> argExpressions, ParsedElement element, int mark, int iLocationsCount, IType rootType, IType[] typeParams, boolean bVerifyArgs, boolean bNoArgsProvided) private booleanreparseErrorsAreDifferent(TypeVarToTypeMap inferenceMap, List<Expression> argExpressions) private MethodScorereparseWithCorrectFunctionAndGtfo(MethodScore bestScore, boolean bShouldScoreMethods, List<Expression> argExpressions, ParsedElement element, int mark, int iLocationsCount, IType rootType, IType[] typeParams, boolean bVerifyArgs, boolean bNoArgsProvided) private voidreset()voidprivate booleanresolveArrayOrParameterizationPartOfTypeLiteral(String[] T, boolean bIgnoreArrayBrackets, TypeLiteral e) private ITyperesolveTypeByRelativeName(String strTypeName) resolveTypeLiteral(String strTypeName) Resolves the type literal given by strTypeName.protected TypeLiteralresolveTypeLiteral(String[] T) protected TypeLiteralresolveTypeLiteral(String[] T, boolean bRelative, boolean bInterface) resolveTypeLiteral(String strTypeName, boolean bRelative, boolean bInterface) private ITyperesolveTypeName(String strTypeName, boolean bRelative) private booleanreturnTypesCompatible(DynamicFunctionSymbol dfsExisting, DynamicFunctionSymbol dfs) private MethodScorescoreMethod(IType callsiteEnclosingType, IType rootType, IInvocableType funcType, List<? extends IInvocableType> listFunctionTypes, List<Expression> argExpressions, boolean bSimple, boolean bLookInCache) private voidscrubAnnotationConstructors(IType declaringClass, List<IConstructorType> listConstructorTypes) voidsetAllowWildcards(boolean allowWildcards) voidsetCaptureSymbolsForEval(boolean bCaputreSymbolsForEval) voidsetContextInferenceManager(ContextInferenceManager ctxInferenceMgr) voidsetDfsDeclInSetByName(Map<String, List<IFunctionSymbol>> dfsDecl) voidsetEditorParser(boolean bStudioEditorParser) (package private) static voidsetFromTargetModifier(IGosuAnnotation anno, ModifierInfo modifierInfo) voidsetGenerateRootExpressionAccessForProgram(boolean bGenRootExprAccess) voidsetLocationsFromProgramClassParser(List<ParseTree> savedLocations) (package private) voidsetNamespace(String strNamespace) private voidsetOperatorLineNumber(Expression expression, int operatorLineNumber) protected voidsetParsed(boolean bParsed) voidsetParsingAnnotation(boolean parsingAnnotation) private voidsetParsingTypeLiteralForNewExpression(boolean value) private voidsetReturnNullExpr(ReturnStatement returnStmt, boolean bProgramCallFunction) voidSet the script or expression to parse and execute.voidsetScript(SourceCodeReader reader) Set the script or expression to parse and execute.voidsetScript(CharSequence source) Set the script or expression to parse and execute.voidsetSymbolTable(ISymbolTable symTable) Sets the parser's symbol table.voidsetThrowParseExceptionForWarnings(boolean bThrowParseExceptionForWarnings) voidsetTokenizer(ISourceCodeTokenizer tokenizer) voidsetTokenizerInstructor(ITokenizerInstructor tokenizerInstructor) voidsetTypeUsesMap(ITypeUsesMap typeUsesMap) Set the type uses map.protected voidvoidsetValidator(IGosuValidator validator) voidsetWarnOnCaseIssue(boolean warnOnCaseIssue) private booleanshouldParseMemberInstead(String strMemberName, IType rootType, IType memberType) private booleanprivate booleanstaticRefToNonStaticFunc(String stFunction, Expression[] eArgs) private booleanprivate StringstripPrefix(String strValue) private booleansupportPropertyAccessAsGetterCall(String[] t, String strFunction, IFunctionSymbol function) private booleansupportsInitializer(IType type) private booleansymbolIn(IDynamicSymbol ds, Collection<? extends ISymbol> symbols) toString()private voidtransferModifierInfo(ParsedElement stmt, ModifierInfo modifiers, AnnotationUseSiteTarget target, EnhancementDynamicFunctionSymbol dfs) private voidtransferModifierInfo(VarStatement varStmt, ModifierInfo modifiers, AnnotationUseSiteTarget target, DynamicFunctionSymbol dfs) private booleantryPostfixUnitExpr(int mark, int locationsCount, Expression lhsExpr, Token priorToken, String connectorString, boolean testConnector) private voidtryToMakeTypeLiteral(String[] T, int iOffset, int iLineNum, int iColumn, String name, Expression errantExpression) booleantypeVarExists(Map<String, ITypeVariableDefinition> typeVarMap, TypeVariableDefinition typeVarDef) private ITypeunitExprType(Expression unitExpr) private ITypeuseDynamicTypeIfDynamicRoot(IInvocableType funcType, IType ctxType) private voidverifyArgCount(ParsedElement element, int iArgs, IConstructorType ctorType) private voidverifyArgCount(ParsedElement element, int iArgs, IFunctionType funcType) private voidverifyArgTypes(IType[] argTypes, List<Expression> argExpressions, List<LightweightParserState> parserStates) private voidverifyCanConstructInnerClassFromCallSite(NewExpression e, IType innerClass) private booleanverifyCanParameterizeType(ParsedElement elem, IType type, IType[] typeParam) private voidverifyCase(ParsedElement element, String foundName, String actualName, IParserState state, ResourceKey errorKey, boolean isEndsWithMatchOK) private voidverifyCase(ParsedElement element, String foundName, String actualName, ResourceKey errorKey, boolean isEndsWithMatchOK) private voidverifyCaseIsUnique(Expression e, List<CaseClause> cases) private voidverifyCoercionSymmetry(EqualityExpression e, Expression lhs, Expression rhs) private ExpressionverifyConditionalTypes(Expression lhs, Expression rhs) private voidverifyConstructorIsAccessible(IType instanceClass, NewExpression e, IConstructorType constructorType, boolean bAnonymous) private voidverifyFunction(DynamicFunctionSymbol dfs, ParsedElement element) (package private) voidverifyFunctionConflictsWithPropoertySetter(ParsedElement element, DynamicFunctionSymbol dfs, DynamicPropertySymbol dps) private voidprivate voidprivate voidprivate voidprivate voidverifyNotWeakerAccess(ParsedElement element, DynamicFunctionSymbol dfs, DynamicFunctionSymbol dfsExisting) private void(package private) voidverifyPropertySetterConflictsWithFunction(ParsedElement element, DynamicFunctionSymbol dfs, String propName, DynamicFunctionSymbol existingDfs) private voidverifyPropertyWritable(IType classRoot, String strProperty, boolean bFromObjInitializer) private voidverifyReified(boolean bValidOverrideFound, ParsedElement element, DynamicFunctionSymbol dfs) private voidprivate voidprivate voidprivate voidprivate voidprivate voidverifySameNumberOfFunctionTypeVars(ParsedElement element, DynamicFunctionSymbol dfs, DynamicFunctionSymbol dfsExisting) private voidverifySuperAccess(Expression rootExpression, Expression memberExpr, IAttributedFeatureInfo feature, String strMemberName) private ITypeverifySuperTypeIsDeclaredInCompilingClass(TypeLiteral superTypeLiteral) private voidverifyTypeAccessible(TypeLiteral expr, IType type) private voidprivate ExpressionverifyWithComparableDimension(Expression rhs, IType lhsType) private voidwarnIfCaseNotTerminated(List<Statement> statements) private voidprivate ExpressionwrapExpressionIfNeeded(Expression first, Expression second) private ReturnStatementMethods inherited from class gw.internal.gosu.parser.ParserBase
addBlockToBlockStack, addError, addError, advanceToNextTokenSilently, captureAllSymbols, captureSymbol, copyBlockStackTo, eatBlock, eatBlock, eatOptionalSemiColon, eatParenthesized, eatPossibleArrayBrackets, eatPossibleArrayBrackets, eatPossibleEnclosedVarInStmt, eatPossibleParametarization, eatPossibleParametarization, eatPossibleStatementBlock, eatStatementBlock, eatTypeLiteral, findAndWrapLocation, findMathOpMethod, getClassStatement, getCurrentEnclosingGosuClass, getCurrentlyInferringFunctionTypeVars, getGosuClass, getLineNumShift, getOffsetShift, getOwner, getParsingAnonymousClass, getUncapturedSymbol, getValidator, isDontOptimizeStatementLists, isEvalClass, isFinalDimension, isOrIsEnclosedByAnonymousClass, isParsingBlock, isTypeVarInReifiedContext, isWordOrValueKeyword, makeFullParserState, makeFullParserStateWithSymbols, makeLazyLightweightParserState, makeLightweightParserState, match, match, match, match, match, match, matchDeclarationKeyword, parseAnnotation, parseDotPathWord, parseModifiers, parseModifiers, peekInferringFunctionTypeVariableTypes, popCurrentBlock, popInferringFunctionTypeVariableTypes, possiblyWrapWithCoercion, possiblyWrapWithImplicitCoercion, pushCurrentBlock, pushInferringFunctionTypeVars, pushModifierList, resolveNamespace, resolveNamespaceSymbol, resolveRuntimeType, resolveSymbol, resolveType, resolveType, resolveTypeForArithmeticExpression, setBlocks, setDontOptimizeStatementLists, setIgnoreWarnings, setLineNumShift, setLocation, setLocation, setLocation, setLocationForImplicitTypeAs, setOffsetShift, setOwner, setSnapshotSymbols, setSubTree, shouldSnapshotSymbols, verify, verify, verify, verify, verify, verify, verifyAnnotations, verifyComparable, verifyComparable, verifyComparable, verifyModifiers, verifyModifiersForFeature, verifyNoAbstractHideOverrideModifierDefined, verifyNoAbstractHideOverrideStaticModifierDefined, verifyNoAbstractHideOverrideStaticModifierDefined, verifyNoAbstractHideStaticModifierDefined, verifyNoAccessibilityModifierDefined, verifyNoCombinedFinalPrivateModifierDefined, verifyNoCombinedFinalStaticModifierDefined, verifyNoCombinedPrivateAbstract, verifyNoHideOverrideModifierDefined, verifyNoHideOverrideStaticModifierDefined, verifyNonVoidExpression, verifyOrWarn, verifyParsedElement, verifyParsedElement, verifyTypesComparable, verifyTypesComparable, verifyTypeVarAreReified, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gw.lang.parser.IGosuParser
isParsingBlock, setIgnoreWarnings, setSnapshotSymbolsMethods inherited from interface gw.lang.parser.IParserPart
getLineNumShift, getOffsetShift, getOwner, isDontOptimizeStatementLists, setDontOptimizeStatementLists, setLineNumShift
-
Field Details
-
PENDING_BOUNDING_TYPE
-
notfound
-
_tokenizer
-
_symTable
-
_bParsed
private boolean _bParsed -
_stack
-
_stackDFS
-
_locations
-
_parsingProgram
-
_parsingFunctions
-
_parsingNewExpressionTypeLiteral
private boolean _parsingNewExpressionTypeLiteral -
_parsingFieldInitializer
-
_dfsDeclByName
-
_typeUsesMap
-
_strNamespace
-
_tokenizerInstructor
-
_scriptabilityConstraint
-
_iBreakOk
private int _iBreakOk -
_iContinueOk
private int _iContinueOk -
_iReturnOk
int _iReturnOk -
_scriptPartIdStack
-
_inferenceMapStack
-
_typeVarsByName
-
_inferredContextStack
-
_bThrowForWarnings
private boolean _bThrowForWarnings -
_bStudioEditorParser
private boolean _bStudioEditorParser -
_bWarnOnCaseIssue
private boolean _bWarnOnCaseIssue -
_parsingAbstractConstructor
-
_ctxInferenceMgr
-
_blockReturnTypeStack
-
_parsingStaticFeature
-
_bCaptureSymbolsForEval
private boolean _bCaptureSymbolsForEval -
_parsingAnnotation
private boolean _parsingAnnotation -
_allowWildcards
private boolean _allowWildcards -
_ignoreTypeDeprecation
private int _ignoreTypeDeprecation -
_bGenRootExprAccess
private boolean _bGenRootExprAccess -
_bProgramCallFunction
private boolean _bProgramCallFunction -
_typeCache
-
_iStmtDepth
private int _iStmtDepth -
_savedLocations
-
_bAreUsingStatementsAllowedInStatementLists
-
BINDER_ASSIGNABILITY_CACHE
-
METHOD_PREFIX_LIST
Using some simple pattern matching, get a potential property name from a method name at the end of an access list. Patterns:
get>mixed-case-name<is>mixed-case-name< -
METHOD_PREFIX_LIST_WITH_SETTER
-
-
Constructor Details
-
GosuParser
GosuParser(ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint) -
GosuParser
GosuParser(ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint, ITypeUsesMap tuMap)
-
-
Method Details
-
setValidator
- Specified by:
setValidatorin interfaceIParserPart- Overrides:
setValidatorin classParserBase
-
getScriptPart
Description copied from interface:IGosuParserThe context associated with the parser's script. E.g., a file name, a library, a rule, etc.- Specified by:
getScriptPartin interfaceIGosuParser
-
getScriptPartIdStack
-
pushScriptPart
-
popScriptPart
-
getInferenceMap
-
pushInferenceMap
-
popInferenceMap
-
setScript
Description copied from interface:IGosuParserSet the script or expression to parse and execute.- Specified by:
setScriptin interfaceIGosuParser- Parameters:
source- The rule (Gosu) source to parse/execute.
-
setScript
Description copied from interface:IGosuParserSet the script or expression to parse and execute.- Specified by:
setScriptin interfaceIGosuParser- Parameters:
src- A reader for the rule (Gosu) source to parse/execute.
-
setScript
Description copied from interface:IGosuParserSet the script or expression to parse and execute.- Specified by:
setScriptin interfaceIGosuParser- Parameters:
reader- A reader for the rule (Gosu) source to parse/execute.
-
resetScript
public void resetScript() -
reset
private void reset() -
getScript
- Specified by:
getScriptin classParserBase
-
getSymbolTable
Description copied from interface:IGosuParserReturns the parser's symbol table.- Specified by:
getSymbolTablein interfaceIGosuParser- Overrides:
getSymbolTablein classParserBase
-
setSymbolTable
Description copied from interface:IGosuParserSets the parser's symbol table.- Specified by:
setSymbolTablein interfaceIGosuParser- Parameters:
symTable- The symbol table the parser will use when parsing and executing rules.
-
getTypeUsesMap
Description copied from interface:IGosuParserGet the type uses map.- Specified by:
getTypeUsesMapin interfaceIGosuParser
-
setTypeUsesMap
Description copied from interface:IGosuParserSet the type uses map.- Specified by:
setTypeUsesMapin interfaceIGosuParser
-
getNamespace
-
setNamespace
-
getVisibilityConstraint
-
getTokenizerInstructor
Description copied from interface:IGosuParserThe TokenizerInstructor to use for this parser. Optional.- Specified by:
getTokenizerInstructorin interfaceIGosuParser
-
setTokenizerInstructor
- Specified by:
setTokenizerInstructorin interfaceIGosuParser
-
peekParsingFunction
-
iterateParsingFunctions
-
popParsingFunction
FunctionType popParsingFunction() -
pushParsingFunction
-
isParsingFunction
public boolean isParsingFunction()- Specified by:
isParsingFunctionin interfaceIGosuParser
-
isParsingTypeListeralForNewExpression
private boolean isParsingTypeListeralForNewExpression() -
setParsingTypeLiteralForNewExpression
private void setParsingTypeLiteralForNewExpression(boolean value) -
peekParsingFieldInitializer
-
popParsingFieldInitializer
VarStatement popParsingFieldInitializer() -
pushParsingFieldInitializer
-
isParsingFieldInitializer
public boolean isParsingFieldInitializer() -
peekParsingProgram
Program peekParsingProgram() -
isParsingProgram
boolean isParsingProgram() -
parseStatements
Description copied from interface:IGosuParserParses a set of Gosu statements. To execute all of the Statements at once call Statement.execute().- Specified by:
parseStatementsin interfaceIGosuParser- Returns:
- The parsed Statement[s].
- Throws:
ParseResultsException- if any of the statements do not parse according to the Gosu grammar.
-
parseStatements
private Statement parseStatements(IScriptPartId partId, boolean verify, boolean isolatedScope) throws ParseResultsException - Throws:
ParseResultsException
-
_parseStatements
void _parseStatements(boolean isolatedScope) -
parseStatementsAndDetectUnreachable
-
popStatementAndDetectUnreachable
-
isUnexpectedToken
-
parseProgram
- Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, IType expectedExpressionType) throws ParseResultsException - Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) throws ParseResultsException - Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException) throws ParseResultsException - Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType) throws ParseResultsException - Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) throws ParseResultsException - Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException) throws ParseResultsException - Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException, IType superType) throws ParseResultsException - Specified by:
parseProgramin interfaceIGosuParser- Throws:
ParseResultsException
-
setGenerateRootExpressionAccessForProgram
public void setGenerateRootExpressionAccessForProgram(boolean bGenRootExprAccess) - Specified by:
setGenerateRootExpressionAccessForProgramin interfaceIGosuParser
-
isGenerateRootExpressionAccessForProgram
public boolean isGenerateRootExpressionAccessForProgram() -
assignRuntime
private void assignRuntime(ParsedElement elem, boolean bIsolatedScope, IFileContext context, IType superType, IScriptPartId partId) throws ParseResultsException - Throws:
ParseResultsException
-
isForStringLiteralTemplate
private boolean isForStringLiteralTemplate() -
parseProgramClasspathStatements
List<IClasspathStatement> parseProgramClasspathStatements() -
parseProgramTypeLoaderStatements
List<ITypeLoaderStatement> parseProgramTypeLoaderStatements() -
parseExp
Description copied from interface:IGosuParserParses a Gosu expression. To evaluate the Expression simply call Expression.evaluate().- Specified by:
parseExpin interfaceIGosuParser- Returns:
- The parsed Expression.
- Throws:
ParseResultsException- if the expression does not parse according to the Gosu grammar.
-
parseExp
public Expression parseExp(IScriptPartId partId, IType expectedExpressionType) throws ParseResultsException Description copied from interface:IGosuParserParses a Gosu expression. To evaluate the Expression simply call Expression.evaluate().- Specified by:
parseExpin interfaceIGosuParser- Returns:
- The parsed Expression.
- Throws:
ParseResultsException- if the expression does not parse according to the Gosu grammar.
-
parseExp
public Expression parseExp(IScriptPartId partId, IType expectedExpressionType, IFileContext context, boolean assignRuntime) throws ParseResultsException Description copied from interface:IGosuParserParses a Gosu expression. To evaluate the Expression simply call Expression.evaluate().- Specified by:
parseExpin interfaceIGosuParser- Returns:
- The parsed Expression.
- Throws:
ParseResultsException- if the expression does not parse according to the Gosu grammar.
-
parseExp
private Expression parseExp(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType, boolean assignRuntime) throws ParseResultsException - Throws:
ParseResultsException
-
parseExp
private Expression parseExp(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType, IFileContext context, boolean assignRuntime) throws ParseResultsException - Throws:
ParseResultsException
-
parseExpOrProgram
Description copied from interface:IGosuParserParses a Gosu expression. If that fails, attempts to parse a Gosu program (which is also an expression, but which has a different grammar.- Specified by:
parseExpOrProgramin interfaceIGosuParser- Parameters:
partId- Script part id- Returns:
- either a pure expression or Program, depending on the source
- Throws:
ParseResultsException- if neither an expression nor a program parses according to the Gosu grammar. We try to make a best guess as to which IParseResultsException to throw, so that the errors are as close as possible to the true cause of the IParseResultsException
-
parseExpOrProgram
public IExpression parseExpOrProgram(IScriptPartId partId, boolean isolatedScope, boolean assignRuntime) throws ParseResultsException Description copied from interface:IGosuParserParses a Gosu expression. If that fails, attempts to parse a Gosu program (which is also an expression, but which has a different grammar.- Specified by:
parseExpOrProgramin interfaceIGosuParser- Parameters:
partId- Script part idisolatedScope- if false, the program will modify the symbol table at the current scope- Returns:
- either a pure expression or Program, depending on the source
- Throws:
ParseResultsException- if neither an expression nor a program parses according to the Gosu grammar. We try to make a best guess as to which IParseResultsException to throw, so that the errors are as close as possible to the true cause of the IParseResultsException
-
parseExpOrProgram
public IExpression parseExpOrProgram(IScriptPartId partId, IType typeExpected, boolean isolatedScope, boolean assignRuntime) throws ParseResultsException - Throws:
ParseResultsException
-
parseTypeLiteral
Description copied from interface:IGosuParserParses a type literal expression. The source must obviously satisfy the type literal syntax.- Specified by:
parseTypeLiteralin interfaceIGosuParser- Throws:
ParseResultsException
-
isParsed
public boolean isParsed()- Specified by:
isParsedin interfaceIGosuParser- Returns:
- Whether or not the referenced Gosu source has been parsed.
-
setParsed
protected void setParsed(boolean bParsed) -
getTokenizer
- Specified by:
getTokenizerin interfaceIGosuParser- Overrides:
getTokenizerin classParserBase
-
getLocationsList
- Overrides:
getLocationsListin classParserBase
-
getLocations
- Specified by:
getLocationsin interfaceIGosuParser- Returns:
- All the locations corresponding to parsed elements.
-
peekLocation
-
hasWarnings
public boolean hasWarnings()- Specified by:
hasWarningsin interfaceIGosuParser- Returns:
- Did the most recent parse have warnings
-
isThrowParseResultsExceptionForWarnings
public boolean isThrowParseResultsExceptionForWarnings()- Specified by:
isThrowParseResultsExceptionForWarningsin interfaceIGosuParser
-
setThrowParseExceptionForWarnings
public void setThrowParseExceptionForWarnings(boolean bThrowParseExceptionForWarnings) - Specified by:
setThrowParseExceptionForWarningsin interfaceIGosuParser
-
parseExpression
void parseExpression() -
parseExpression
-
parseExpression
-
parseExpressionNoVerify
-
setContextInferenceManager
-
pushInferredContextTypes
-
popInferredContextTypes
public void popInferredContextTypes() -
getContextType
-
convertNullLiterals
-
convertNumberLiteralsToContextType
-
getNumberTypeFromContextType
-
parseConditionalExpression
void parseConditionalExpression() -
_parseConditionalExpression
void _parseConditionalExpression() -
isPrimitiveOrBoxedOrBigIntegerOrBigDecimal
-
findLeastUpperBoundWithCoercions
private IType findLeastUpperBoundWithCoercions(ConditionalTernaryExpression cte, Expression first, Expression second) -
canCoerceFromString
-
wrapExpressionIfNeeded
-
parseConditionalOrExpression
void parseConditionalOrExpression() -
parseConditionalAndExpression
void parseConditionalAndExpression() -
parseBitwiseOrExpression
void parseBitwiseOrExpression() -
ensureOperandIntOrLongOrBoolean
-
isPrimitiveOrBoxedIntegerType
-
ensureOperandBoolean
-
ensureOperandIntOrLong
-
parseBitwiseXorExpression
void parseBitwiseXorExpression() -
parseBitwiseAndExpression
void parseBitwiseAndExpression() -
parseEqualityExpression
private void parseEqualityExpression() -
isConditional
-
_parseEqualityExpression
private void _parseEqualityExpression() -
warnOnSuspiciousEqualsOperator
-
isThisPointer
-
isEqualsArgReference
-
verifyCoercionSymmetry
-
verifyRelationalOperandsComparable
-
verifyConditionalTypes
-
areMetaTypes
-
verifyWithComparableDimension
-
parseRelationalExpression
void parseRelationalExpression() -
parseIntervalExpression
void parseIntervalExpression() -
_parseIntervalExpression
void _parseIntervalExpression() -
parseBitshiftExpression
void parseBitshiftExpression() -
matchRightShift
private boolean matchRightShift() -
parseAdditiveExpression
void parseAdditiveExpression() -
parseMultiplicativeExpression
void parseMultiplicativeExpression() -
parseTypeAsExpression
void parseTypeAsExpression() -
checkComparableAndCastable
-
parseUnaryExpression
void parseUnaryExpression() -
parseUnaryExpressionNotPlusMinus
void parseUnaryExpressionNotPlusMinus() -
checkMemberAccessIsReadable
private void checkMemberAccessIsReadable() -
_parseUnaryExpressionNotPlusMinus
void _parseUnaryExpressionNotPlusMinus() -
parseEvalExpression
private void parseEvalExpression() -
isCaptureSymbolsForEval
public boolean isCaptureSymbolsForEval()- Specified by:
isCaptureSymbolsForEvalin interfaceIGosuParser
-
setCaptureSymbolsForEval
public void setCaptureSymbolsForEval(boolean bCaputreSymbolsForEval) - Specified by:
setCaptureSymbolsForEvalin interfaceIGosuParser
-
parsePrimaryExpression
void parsePrimaryExpression() -
_parsePrimaryExpression
-
parseBindableExpression
void parseBindableExpression() -
parseBindableExpression
void parseBindableExpression(boolean bPostfix) -
parseBindableExpression
-
parseBindableExpression
-
parseBindingExpression
-
parseBindingExpression
-
hasMethod_Cached
-
parsePrefixUnitBindingExpression
-
unitExprType
-
backtrackBinderExpr
-
parsePostfixUnitBindingExpression
-
tryPostfixUnitExpr
private boolean tryPostfixUnitExpr(int mark, int locationsCount, Expression lhsExpr, Token priorToken, String connectorString, boolean testConnector) -
isConnectorStringValid
private boolean isConnectorStringValid(boolean bPostfix, String connectorString, Expression unitExpr, IType unitBinderType) -
parseUnitExpression
private boolean parseUnitExpression() -
parseUnitExpressionFactor
-
hasMethod
-
parseBooleanLiteral
-
parseNullLiteral
-
parseStandAloneDataStructureInitialization
-
parseStandAloneDataStructureInitialization
private boolean parseStandAloneDataStructureInitialization(Token token, boolean bAvoidContextType, boolean bBacktracking) -
maybeReparseWithoutContextType
private boolean maybeReparseWithoutContextType(int mark, int iLocationsCount, Expression initializerExpression) -
shouldThisExpressionAvoidTheContextType
private boolean shouldThisExpressionAvoidTheContextType() -
getTypes
-
getInitializableType
-
getCurrentInitializableContextType
-
findImpl
-
supportsInitializer
-
parseBlockExpression
private void parseBlockExpression() -
getBlockReturnType
-
getContextTypesForBlockArgument
-
inferReturnTypeForBlockArgument
-
parseNewExpression
void parseNewExpression()new-expression new <type-expression> ( [<argument-list>] ) { [<initialization-expression>] } new <type-expression> [ <expression> ] new <type-expression> [] { [<array-value-list>] } -
parseNewExpressionOrAnnotation
void parseNewExpressionOrAnnotation(boolean bAnnotation) -
_parseNewExpressionOrAnnotation
void _parseNewExpressionOrAnnotation(boolean bAnnotation, boolean bBacktracking) -
maybeInferTypeLiteralFromContextType
-
parseNewExpressionOrAnnotation
void parseNewExpressionOrAnnotation(IType declaringClass, boolean bAnnotation, boolean bNoArgNoParenthesis, TypeLiteral typeLiteral, int mark) -
maybeChangeToInferredType
private IType maybeChangeToInferredType(IType declaringClass, TypeLiteral typeLiteral, MethodScore bestConst) -
scrubAnnotationConstructors
private void scrubAnnotationConstructors(IType declaringClass, List<IConstructorType> listConstructorTypes) -
isAnnotation
-
getPreliminaryConstructorTypes
private ArrayList<IConstructorType> getPreliminaryConstructorTypes(IType declaringClass, NewExpression e) -
parseAnonymousInnerClass
private IType parseAnonymousInnerClass(IType declaringClass, TypeLiteral typeLiteral, NewExpression newExpr, int state, int mark) -
_parseAnonymousInnerClass
private void _parseAnonymousInnerClass(IType declaringClass, IGosuClassInternal gsDeclaringClass, ICompilableTypeInternal enclosingType, int iNameOffset, NewExpression newExpr, int mark) -
isParsingStaticFeature
public boolean isParsingStaticFeature() -
pushParsingStaticMember
-
popParsingStaticMember
public void popParsingStaticMember() -
isParsingAbstractConstructor
public boolean isParsingAbstractConstructor() -
pushParsingAbstractConstructor
-
popParsingAbstractConstructor
public void popParsingAbstractConstructor() -
getConstructor
-
verifyConstructorIsAccessible
private void verifyConstructorIsAccessible(IType instanceClass, NewExpression e, IConstructorType constructorType, boolean bAnonymous) -
getModifierString
-
parseObjectInitializer
-
_parseObjectInitializer
-
_doParseObjectInitializer
-
parseInitializerAssignment
-
parseInitializerIdentifier
-
getGsConstructorInfo
private GosuConstructorInfo getGsConstructorInfo(IConstructorInfo ci, IGosuClassInternal gsInstanceClass) -
isConcreteInitializableType
-
isInitializableType
-
verifyCanConstructInnerClassFromCallSite
-
isConstructingNonStaticInnerClassFromNonStaticContext
private boolean isConstructingNonStaticInnerClassFromNonStaticContext(IType innersEnclosingClass, IGosuClassInternal constructingFromClass) -
isNonStaticInnerClassConstructableFromCurrentFunction
private boolean isNonStaticInnerClassConstructableFromCurrentFunction(IType innersEnclosingClass, IGosuClassInternal constructingFromClass) -
_parseInitializerExpression
-
getImplicitConstructor
-
parseCollectionInitializerList
-
parseMapInitializerList
-
parseArrayValueList
-
parseIndirectMemberAccess
private void parseIndirectMemberAccess(int iOffset, int iLineNum, int iColumn) -
parseIndirectMemberAccess
private void parseIndirectMemberAccess(int iOffset, int iLineNum, int iColumn, boolean bParsingTypeLiteralOnly) -
maybeReplacePackageExprWithTypeLiteral
private void maybeReplacePackageExprWithTypeLiteral(int iOffset, int iLineNum, int iColumn, Expression expr) -
maybeReplaceErrantPackageExprWithEnumConstEpr
private boolean maybeReplaceErrantPackageExprWithEnumConstEpr(int iOffset, int iLineNum, int iColumn, Expression expr) -
_parseIndirectMemberAccess
boolean _parseIndirectMemberAccess(boolean bParseTypeLiteralOnly) -
verifySuperTypeIsDeclaredInCompilingClass
-
isSuperCall
-
parseFeatureLiteral
-
parseErrantFeatureLiteralParameterization
-
evalTypes
-
allTypeLiterals
-
setOperatorLineNumber
-
parseNameOrMethodCall
-
_parseNameOrMethodCall
-
parseMethodCall
private void parseMethodCall(String[] t, int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, MethodCallExpression e, IType[] typeParameters, String strFunction, ISymbol functionSymbol, int markBeforeTypeArgs, int iLocBeforeTypeArgs, int markAfterTypeArgs) -
hasParseExceptions
-
maybeParseImpliedThisMethod
private boolean maybeParseImpliedThisMethod(int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, String strFunction, int markBeforeTypeArgs, int iLocBeforeTypeArgs) -
maybeParseImpliedStaticMethod
private void maybeParseImpliedStaticMethod(int iOffset, int iLineNum, int iColumn, LazyLightweightParserState state, String strFunction, int markBeforeTypeArgs, int iLocBeforeTypeArgs) -
maybeParseIdentifierAssumingOpenParenIsForParenthesizedExpr
private void maybeParseIdentifierAssumingOpenParenIsForParenthesizedExpr(String[] t, int iOffset, int iLineNum, int iColumn, IParserState state, MethodCallExpression e, IType[] typeParameters, String strFunction, ISymbol functionSymbol, int mark, int iLocationsCount) -
backtrack
void backtrack(int mark, int iLocationsCount) -
backtrack
-
parseMethodCall
private void parseMethodCall(String[] t, IParserState state, MethodCallExpression e, IType[] typeParameters, String strFunction, ISymbol functionSymbol) -
verifyReifiedCallHasProperContext
-
supportPropertyAccessAsGetterCall
private boolean supportPropertyAccessAsGetterCall(String[] t, String strFunction, IFunctionSymbol function) -
maybeCaptureSymbol
-
isInSeparateStringTemplateExpression
private boolean isInSeparateStringTemplateExpression() -
possiblyResolveFunctionSymbol
-
isBlockSym
-
staticRefToNonStaticFunc
-
staticRefToNonStaticProp
-
boundFunctionType
-
getDFSForFunctionType
-
verifyNotCallingOverridableFunctionFromCtor
-
verifyNotCallingOverridableFunctionFromCtor
-
isParsingConstructor
private boolean isParsingConstructor() -
parsePossibleFunctionParameterization
-
parseIdentifier
-
parseIdentifier
-
verifyReifiedCallHasProperContext
private void verifyReifiedCallHasProperContext(PropertyAccessIdentifier e, DynamicPropertySymbol dps) -
parseIdentifierOrTypeLiteralOrEnumConstant
private void parseIdentifierOrTypeLiteralOrEnumConstant(String[] T, int iOffset, int iLineNum, int iColumn) -
tryToMakeTypeLiteral
private void tryToMakeTypeLiteral(String[] T, int iOffset, int iLineNum, int iColumn, String name, Expression errantExpression) -
parseNamespaceStartOrRelativeType
-
parseUnqualifiedEnumConstant
-
verifyArgCount
-
verifyOverrideNotOnMethodThatDoesNotExtend
private void verifyOverrideNotOnMethodThatDoesNotExtend(ParsedElement element, DynamicFunctionSymbol dfs) -
verifyArgCount
-
parsePlainFunction
-
parseDynamicFunction
-
parseMemberAccess
private void parseMemberAccess(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly) -
parseMemberAccess
private void parseMemberAccess(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty) -
parseMethodMember
private void parseMethodMember(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty, BeanMethodCallExpression e, IType rootType, boolean bExpansion, IType[] typeParameters, int iParenStart, int mark) -
maybeOpenParenIsForParenthesizedExpr
private void maybeOpenParenIsForParenthesizedExpr(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty, BeanMethodCallExpression e, IType rootType, boolean bExpansion, IType[] typeParameters, int iParenStart, int mark, int iLocationsCount) -
isOpenParenOnNextLine
private boolean isOpenParenOnNextLine(int mark) -
parseMethodMember
private void parseMethodMember(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, BeanMethodCallExpression e, IType rootType, boolean bExpansion, IType[] typeParameters, int iParenStart) -
findFunction
-
verifyReifiedCallHasProperContext
-
parsePropertyMember
private void parsePropertyMember(Expression rootExpression, MemberAccessKind kind, int iTokenStart, String strMemberName, LazyLightweightParserState state, boolean bParseTypeLiteralOnly, boolean createSynthesizedProperty, IType rootType, boolean bExpansion) -
verifyReifiedCallHasProperContext
-
verifySuperAccess
private void verifySuperAccess(Expression rootExpression, Expression memberExpr, IAttributedFeatureInfo feature, String strMemberName) -
shouldParseMemberInstead
-
isEndOfArgExpression
private boolean isEndOfArgExpression() -
isParenthesisTerminalExpression
private boolean isParenthesisTerminalExpression() -
isParenthesisTerminalExpression
private boolean isParenthesisTerminalExpression(boolean bMatchOpeningParen) -
isEndOfExpression
private boolean isEndOfExpression() -
getInnerClass
-
maybeParameterizeOnCtxType
-
getPreliminaryFunctionTypes
private List<IFunctionType> getPreliminaryFunctionTypes(String strMemberName, BeanMethodCallExpression e, IType rootType, IType[] typeParameters) -
addJavaPropertyMethods
private void addJavaPropertyMethods(String strMemberName, IType rootType, List<IFunctionType> listFunctionTypes) -
maybeGetProxiedPropertyInfo
-
isBlockInvoke
-
isErrorType
-
parameterizeFunctionTypes
private ArrayList<IFunctionType> parameterizeFunctionTypes(Expression expression, IType[] typeParameters, List<IFunctionType> listFunctionTypes) -
handleAbstractCtor
private void handleAbstractCtor(int iTokenStart, String strMemberName, BeanMethodCallExpression e, IParserState state) -
verifyCanParameterizeType
-
isTypeParamHeaderCompiling
-
parseFunctionParameterization
-
parseArgumentList
private MethodScore parseArgumentList(IType rootType, ParsedElement element, List<? extends IInvocableType> listFunctionTypes, IType[] typeParams, boolean bVerifyArgs, boolean bNoArgsProvided) -
findLeastParams
Param count is the tiebreaker when vararg methods are involved. The only way there can be valid method calls differing by param count is when one or more vararg methods match. If a non-vararg method matches with fewer params, this indicates the vararg method matched because the vararg argument was not present in the call. -
reparseWithCorrectFunctionAndGtfo
private MethodScore reparseWithCorrectFunctionAndGtfo(MethodScore bestScore, boolean bShouldScoreMethods, List<Expression> argExpressions, ParsedElement element, int mark, int iLocationsCount, IType rootType, IType[] typeParams, boolean bVerifyArgs, boolean bNoArgsProvided) -
reparseErrorsAreDifferent
private boolean reparseErrorsAreDifferent(TypeVarToTypeMap inferenceMap, List<Expression> argExpressions) -
errorsSame
-
reparseArguments
private MethodScore reparseArguments(MethodScore bestScore, List<Expression> argExpressions, ParsedElement element, int mark, int iLocationsCount, IType rootType, IType[] typeParams, boolean bVerifyArgs, boolean bNoArgsProvided) -
maskCurrentFunctionTypeVarsFromPriorInference
-
maybeInferFunctionTypeVarsFromReturnType
private void maybeInferFunctionTypeVarsFromReturnType(IInvocableType invType, TypeVarToTypeMap inferenceMap) -
factorInParseErrors
-
hasContextSensitiveExpression
-
isGenericMethodCall
-
maybeAvoidNestedMethodScoring
private List<? extends IInvocableType> maybeAvoidNestedMethodScoring(List<? extends IInvocableType> listFunctionTypes) -
backtrackArgParsing
-
maybeRemoveNonGenericMethods
private List<? extends IInvocableType> maybeRemoveNonGenericMethods(List<? extends IInvocableType> listFunctionTypes, IType[] typeParams) -
maybeReassignOffsetForArgumentListClause
private void maybeReassignOffsetForArgumentListClause(int iArgs, List<Expression> argExpressions, int iOffset, int iLineNum, int iColumn) -
maybeBoundFunctionTypeVars
private IInvocableType maybeBoundFunctionTypeVars(IInvocableType inferredFunctionType, TypeVarToTypeMap inferenceMap) -
assignArgExprPosition
-
addMisingArgsWithDefaultValues
void addMisingArgsWithDefaultValues(ParsedElement element, IInvocableType funcType, List<Expression> argExpressions, List<LightweightParserState> parserStates, boolean bShouldScoreMethods) -
parseArgExpression
private int parseArgExpression(IInvocableType funcType, int iArgs, List<Expression> argExpressions, TypeVarToTypeMap inferenceMap, List<LightweightParserState> parserStates, Set<String> namedArgs, boolean bMethodScoring) -
useDynamicTypeIfDynamicRoot
-
getDefaultValueOrPlaceHolderForParam
-
parseNamedParamExpression
-
getParamTypeFromParamName
-
parseNamedParamIdentifier
private void parseNamedParamIdentifier() -
isDynamicMethod
-
makeDynamicMethodScore
private MethodScore makeDynamicMethodScore(List<? extends IInvocableType> listFunctionTypes, List<Expression> argExpressions) -
getParamTypes
-
scoreMethod
private MethodScore scoreMethod(IType callsiteEnclosingType, IType rootType, IInvocableType funcType, List<? extends IInvocableType> listFunctionTypes, List<Expression> argExpressions, boolean bSimple, boolean bLookInCache) -
boundCtxType
-
boundCtxType
-
inferFunctionTypeVariables
private void inferFunctionTypeVariables(IType rawContextType, IType boundContextType, Expression expression, TypeVarToTypeMap inferenceMap) -
inferArgType
-
handleImplicitCoercionsInArgs
private void handleImplicitCoercionsInArgs(ParsedElement element, IType[] argTypes, IType[] rawArgTypes, List<Expression> args) -
extractContextTypes
-
verifyArgTypes
private void verifyArgTypes(IType[] argTypes, List<Expression> argExpressions, List<LightweightParserState> parserStates) -
parseLiteral
-
_parseLiteral
-
parseRelativeFeatureLiteral
-
parseNumberLiteral
-
atNumberLiteralStart
private boolean atNumberLiteralStart() -
parseNumberLiteral
-
parseNumericValue
-
parseIntOrLongOrBigInt
-
stripPrefix
-
parseDoubleOrBigDec
-
parseFloat
-
parseDouble
-
parseExplicitlyTypedNumericLiteral
-
isPrefixNumericLiteral
-
parsePrefixNumericLiteral
-
isHexLiteral
-
isBinLiteral
-
parsePostfixNumericLiteral
-
maybeStripTypeModifier
-
hasTypeModifier
-
pushErrorNumberLiteral
-
getNumericTypeFrom
-
parseCharLiteral
-
parseStringLiteralSeparately
private boolean parseStringLiteralSeparately() -
parseStringLiteral
-
_parseStringLiteral
-
parseTemplatizedStringLiteral
-
parseTypeLiteral
public boolean parseTypeLiteral()Description copied from interface:IGosuParserConsumes a type literal from the current tokenizer, if one exists.- Specified by:
parseTypeLiteralin interfaceIGosuParser- Returns:
- true if a type literal was found, false otherwise
-
parseTypeLiteral
-
parseTypeLiteral
boolean parseTypeLiteral(boolean bInterface) -
parseTypeLiteral
-
parseTypeLiteralForNewExpression
void parseTypeLiteralForNewExpression() -
_parseTypeLiteralWithAggregateSyntax
boolean _parseTypeLiteralWithAggregateSyntax(Token token, boolean bIgnoreArrayBrackets, boolean bInterface) -
_parseTypeLiteral
-
matchPrimitiveType
boolean matchPrimitiveType(boolean bSuperThis) -
parseAggregateTypeLiteral
private void parseAggregateTypeLiteral(boolean bInterface) -
addToCompoundType
-
parseBlockLiteral
void parseBlockLiteral() -
_parseBlockLiteral
void _parseBlockLiteral() -
parseTypeLiteral
void parseTypeLiteral(String[] T, boolean bIgnoreArrayBrackets, boolean bInterface, int iOffset, int iLineNum, int iColumn) -
verifyTypeAccessible
-
parseCompoundTypeLiteralExpression
private void parseCompoundTypeLiteralExpression(String[] T, boolean bInterface, int iOffset, int iLineNum, int iColumn) -
isTypeParameterErrorMsg
-
resolveArrayOrParameterizationPartOfTypeLiteral
private boolean resolveArrayOrParameterizationPartOfTypeLiteral(String[] T, boolean bIgnoreArrayBrackets, TypeLiteral e) - Returns:
- True if parsed parameterized type.
-
isParsingCompileTimeConstantExpression
private boolean isParsingCompileTimeConstantExpression() -
parseArrayType
-
parseTypeParameters
-
makeTypeParameterListClause
private void makeTypeParameterListClause(int iOffset, int iLineNum, int iColumn, List<TypeLiteral> paramTypes) -
parseParameterType
-
boxTypeLiteralsType
-
parseStatement
boolean parseStatement() -
parseStatement
boolean parseStatement(boolean bAsStmtBlock) -
parseStatement
boolean parseStatement(boolean forceKeepStmtBlock, boolean bAsStmtBlock) -
hasSemicolon
-
parseLoopStatement
boolean parseLoopStatement() -
_parseStatement
boolean _parseStatement() -
parseAssertStatement
private void parseAssertStatement() -
areUsingStatementsAllowedInStatementLists
private boolean areUsingStatementsAllowedInStatementLists() -
getStatementDepth
private int getStatementDepth() -
incStatementDepth
private void incStatementDepth() -
decStatementDepth
private void decStatementDepth() -
parseLocalVarStatement
-
parseVarStatement
-
isLocalVarTopLevelFunctionBodyStmt
private boolean isLocalVarTopLevelFunctionBodyStmt() -
detectLikelyJavaCast
-
recoverFromJavaStyleCast
-
parseVarPropertyClause
DynamicPropertySymbol parseVarPropertyClause(VarStatement varStmt, ModifierInfo modifiers, String strVarIdentifier, IType varType, boolean parseInitializer) -
makeProperties
DynamicPropertySymbol makeProperties(VarStatement varStmt, String strVarIdentifier, String strPropertyName, IType varType, ModifierInfo modifiers, boolean bGetter, boolean bSetter) -
makeGetter
private DynamicPropertySymbol makeGetter(VarStatement varStmt, String strVarIdentifier, String strPropertyName, IType varType, ModifierInfo modifiers, ISymbol symbol, ICompilableType gsClass, boolean bOldSyntax) -
makeSetter
private DynamicPropertySymbol makeSetter(VarStatement varStmt, String strVarIdentifier, String strPropertyName, IType varType, ModifierInfo modifiers, ISymbol symbol, ICompilableType gsClass, DynamicPropertySymbol dps, boolean bOldSyntax) -
transferModifierInfo
private void transferModifierInfo(VarStatement varStmt, ModifierInfo modifiers, AnnotationUseSiteTarget target, DynamicFunctionSymbol dfs) -
transferModifierInfo
private void transferModifierInfo(ParsedElement stmt, ModifierInfo modifiers, AnnotationUseSiteTarget target, EnhancementDynamicFunctionSymbol dfs) -
setFromTargetModifier
-
appliesToElementType
-
parseDelegateStatement
-
parseSwitchStatement
private void parseSwitchStatement() -
parseDoWhileStatement
private void parseDoWhileStatement() -
verifyLoopConditionNotAlwaysFalse
-
parseWhileStatement
private void parseWhileStatement() -
parseForEachStatement
private void parseForEachStatement() -
parseIndexVar
-
parseIteratorVar
-
parseReturnStatement
private void parseReturnStatement() -
inConstructorCtx
private boolean inConstructorCtx() -
setReturnNullExpr
-
parseThrowStatement
private void parseThrowStatement() -
parseTryCatchFinallyStatement
private void parseTryCatchFinallyStatement() -
parseIfStatement
private void parseIfStatement() -
parseUsingStatement
private void parseUsingStatement() -
parseVarStatementsInUsingStatement
-
verifyTypeForUsingStatementPredicate
-
isAssignableFrom
-
maybeRemoveIMonitorLockError
-
parseStatementBlock
private void parseStatementBlock() -
parseStatementBlock
private void parseStatementBlock(boolean bMatchClosingBrace) -
parseStatementBlock
private void parseStatementBlock(boolean forceKeepStmtBlock, boolean bMatchClosingBrace) -
parseNamespaceStatement
void parseNamespaceStatement() -
parseNamespaceStatement_editor
void parseNamespaceStatement_editor() -
parseNamespaceStatement_normal
void parseNamespaceStatement_normal() -
parseUsesStatementList
- Specified by:
parseUsesStatementListin interfaceIGosuParser
-
parseUsesStatement
void parseUsesStatement() -
parseUsesStatement
void parseUsesStatement(boolean bResolveTypes) -
processUsesStatementFeatureLiteral
private void processUsesStatementFeatureLiteral(boolean bResolveTypes, UsesStatement usesStmt, TypeLiteral typeLiteral, FeatureLiteral fl) -
processUsesStatement
private void processUsesStatement(UsesStatement usesStmt, TypeLiteral typeLiteral, IFeatureInfo fi, IGosuClass gsType) -
getAllStaticFeatures
-
processUsesStatementTypeLiteral
private void processUsesStatementTypeLiteral(boolean bResolveTypes, UsesStatement usesStmt, TypeLiteral typeLiteral) -
parseCaseClauses
-
parseCaseClause
-
verifyCaseIsUnique
-
isIsolatedCase
-
warnIfCaseNotTerminated
-
parseDefaultClause
-
checkInstruction
void checkInstruction(boolean bProcessDirectives) -
checkUnexpectedEof
private void checkUnexpectedEof() -
clearExpressionInTemplateUnlessParsingEvaluateFunctionBody
-
removeInnerClasses
-
removeLocation
-
parseDirective
private void parseDirective(boolean processDirectives) -
parseAssignmentOrMethodCall
boolean parseAssignmentOrMethodCall() -
parseAssignment
-
isParsingProgramEvaluateMethod
private boolean isParsingProgramEvaluateMethod() -
isSymbolInScopeDirectly
-
parseAssignmentRhs
-
buildRhsOfCompoundOperator
-
matchAssignmentOperator
-
matchRightShiftAssign
-
parseFunctionOrPropertyDeclaration
-
parsePropertyDefinition
boolean parsePropertyDefinition() -
getOrCreateDynamicPropertySymbol
DynamicPropertySymbol getOrCreateDynamicPropertySymbol(ParsedElement parsedElement, IGosuClassInternal gsClass, DynamicFunctionSymbol dfs, boolean bGetter) -
parseFunctionDefinition
boolean parseFunctionDefinition() -
parseBaseFunctionDefinition
FunctionStatement parseBaseFunctionDefinition(FunctionStatement functionStmt, boolean bProperty, boolean bGetter, ModifierInfo modifiers) -
getLastStatement
-
isValidAnnotationMethodReturnType
-
putThisAndSuperSymbols
-
findProgramPropertyDfs
private DynamicFunctionSymbol findProgramPropertyDfs(String strFunctionName, ArrayList<ISymbol> args) -
getTypeVarDefsFromDecl
-
findCorrespondingDeclDfs
-
isDeclarationKeyword
-
assignPossibleDuplicateDfs
static DynamicFunctionSymbol assignPossibleDuplicateDfs(DynamicFunctionSymbol dfsDecl, Iterable symbols) -
addNameInDeclaration
void addNameInDeclaration(String strName, int iOffsetName, int iLineNumName, int iColumnName, boolean bHasName) -
parsingFunctionsEncloseMyClass
private boolean parsingFunctionsEncloseMyClass() -
parseProgramEntryPointBody
FunctionStatement parseProgramEntryPointBody() -
getProgramEntryPointDfs
-
handleExpressionStatementList
-
wrapProgramExpressionInReturnStmt
-
addDefaultReturnStmt
-
parseProgramFunctionBody
-
parseProgramExpr
private void parseProgramExpr() -
maybeSetExternalSymbols
private void maybeSetExternalSymbols() -
removeLocationsFrom
void removeLocationsFrom(int iLocationsCount) -
isTerminal
-
parseFunctionBody
-
parseFunctionDecl
-
parseFunctionDecl
DynamicFunctionSymbol parseFunctionDecl(ParsedElement element, boolean bProperty, boolean bGetter, ModifierInfo modifiers) -
parseFunctionDecl
DynamicFunctionSymbol parseFunctionDecl(ParsedElement element, String T, boolean bProperty, boolean bGetter, ModifierInfo modifiers) -
matchNonDeclarationKeyword
private boolean matchNonDeclarationKeyword() -
maybeEatNonDeclKeyword
-
verifyFunction
-
verifyReified
private void verifyReified(boolean bValidOverrideFound, ParsedElement element, DynamicFunctionSymbol dfs) -
areParametersEquivalent_Enhancement
private boolean areParametersEquivalent_Enhancement(DynamicFunctionSymbol dfs1, DynamicFunctionSymbol dfs2) -
maybeAddPrivateFunctionsIfSuperInSamePackage
private List<IFunctionSymbol> maybeAddPrivateFunctionsIfSuperInSamePackage(String name, List<IFunctionSymbol> functions) -
addAllNonstaticPrivateMethods
private void addAllNonstaticPrivateMethods(String name, IGosuClassInternal superClass, List<IFunctionSymbol> functions) -
propertyTypeDiffers
-
verifySameNumberOfFunctionTypeVars
private void verifySameNumberOfFunctionTypeVars(ParsedElement element, DynamicFunctionSymbol dfs, DynamicFunctionSymbol dfsExisting) -
areDFSsInSameNameSpace
-
verifyNoImplicitPropertyMethodConflicts
private void verifyNoImplicitPropertyMethodConflicts(ParsedElement element, DynamicFunctionSymbol dfs) -
verifyFunctionConflictsWithPropoertySetter
void verifyFunctionConflictsWithPropoertySetter(ParsedElement element, DynamicFunctionSymbol dfs, DynamicPropertySymbol dps) -
verifyPropertySetterConflictsWithFunction
void verifyPropertySetterConflictsWithFunction(ParsedElement element, DynamicFunctionSymbol dfs, String propName, DynamicFunctionSymbol existingDfs) -
returnTypesCompatible
-
areParametersEquivalent
private boolean areParametersEquivalent(IDynamicFunctionSymbol dfs, IDynamicFunctionSymbol dfsExisting, IType... extraParams) -
_areParametersEquivalent
private boolean _areParametersEquivalent(IDynamicFunctionSymbol dfs1, IDynamicFunctionSymbol dfs2, IType[] args, IType[] toArgs) -
maybeResolveFunctionTypeVars
-
doParametersReifyToSameBytecodeType
public boolean doParametersReifyToSameBytecodeType(IDynamicFunctionSymbol dfs, IDynamicFunctionSymbol dfsExisting) -
doTypesReifyToTheSameBytecodeType
-
getOwningTypeForDfs
-
verifyNotWeakerAccess
private void verifyNotWeakerAccess(ParsedElement element, DynamicFunctionSymbol dfs, DynamicFunctionSymbol dfsExisting) -
parseParameterDeclarationList
public ArrayList<ISymbol> parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes) - Specified by:
parseParameterDeclarationListin interfaceIGosuParser
-
parseParameterDeclarationList
public ArrayList<ISymbol> parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes, boolean bProperty, boolean bGetter, boolean bEmpty, boolean bVarDynamicArg) -
parseLocalAnnotations
-
parseTypeVariableDefs
List<ITypeVariableDefinitionExpression> parseTypeVariableDefs(ParsedElement parsedElem, boolean bFunction, List<TypeVariableDefinitionImpl> typeVarDefListFromDecl) -
parseTypeVariableDefList
List<ITypeVariableDefinitionExpression> parseTypeVariableDefList(ParsedElement parsedElem, boolean bForFunction, List<TypeVariableDefinitionImpl> typeVarDefListFromDecl) -
typeVarExists
public boolean typeVarExists(Map<String, ITypeVariableDefinition> typeVarMap, TypeVariableDefinition typeVarDef) -
parseTypeVariableDefinition
void parseTypeVariableDefinition(ParsedElement parsedElem, TypeVariableDefinition typeVarDef, boolean bFirstPass) -
_parseTypeVariableDefinition
boolean _parseTypeVariableDefinition(ParsedElement parsedElem, TypeVariableDefinition typeVarDef, boolean bFirstPass) -
parseVariance
-
getEnclosingType
-
isCompilingOrReparsingHeader
private boolean isCompilingOrReparsingHeader() -
pushExpression
- Overrides:
pushExpressionin classParserBase
-
maybeVerifyDoubleLiterals
-
maybeVerifyDoubleLiteral
-
popExpression
- Specified by:
popExpressionin interfaceIGosuParser- Overrides:
popExpressionin classParserBase
-
setTokenizer
- Specified by:
setTokenizerin interfaceIGosuParser
-
peekExpression
- Overrides:
peekExpressionin classParserBase
-
peekParsedElement
-
pushStatement
- Overrides:
pushStatementin classParserBase
-
popStatement
- Overrides:
popStatementin classParserBase
-
peekStatement
- Overrides:
peekStatementin classParserBase
-
pushDynamicFunctionSymbol
-
popDynamicFunctionSymbol
-
peekDynamicFunctionSymbol
-
clearDfsStack
protected void clearDfsStack() -
putDfsDeclsInTable
- Specified by:
putDfsDeclsInTablein interfaceIGosuParser
-
putDfsDeclInSetByName
- Specified by:
putDfsDeclInSetByNamein interfaceIGosuParser
-
nextIndexOfErrantDuplicateDynamicSymbol
public int nextIndexOfErrantDuplicateDynamicSymbol(IDynamicSymbol ds, Collection<? extends ISymbol> symbols, boolean bCheckContains) -
symbolIn
-
setDfsDeclInSetByName
- Specified by:
setDfsDeclInSetByNamein interfaceIGosuParser
-
newDfsDeclInSetByName
protected void newDfsDeclInSetByName() -
getDfsDecls
- Specified by:
getDfsDeclsin interfaceIGosuParser
-
getFunctionTypesForName
-
resolveTypeLiteral
-
resolveTypeLiteral
-
getDfsDeclsForFunction
-
resolveTypeLiteral
Resolves the type literal given by strTypeName. If parentType is non null then strTypeName is assumed relative to the given parent.- Specified by:
resolveTypeLiteralin interfaceIGosuParser- Parameters:
strTypeName-
-
resolveTypeLiteral
-
resolveTypeName
-
getTypeVarDef
-
getEnclosingTypeVars
-
resolveTypeByRelativeName
-
getTypeVariables
- Specified by:
getTypeVariablesin interfaceIGosuParser
-
setTypeVariables
-
parseClass
public IGosuClassInternal parseClass(String strQualifiedClassName, ISourceFileHandle sourceFile, boolean bThrowOnWarnings, boolean bFullyCompile) throws ParseResultsException Description copied from interface:IGosuParserFor use by code editors etc.- Specified by:
parseClassin interfaceIGosuParser- Throws:
ParseResultsException
-
getFunctionType
public IFunctionType getFunctionType(IType classBean, String functionName, Expression[] eArgs, List<IFunctionType> listAllMatchingMethods, GosuParser parser, boolean bMatchParamTypes) throws ParseException - Throws:
ParseException
-
checkForStaticMethod
private void checkForStaticMethod(IType classBean, Expression[] eArgs, String strMethod, GosuParser parserState) throws ParseException - Throws:
ParseException
-
inferFunctionType
private IInvocableType inferFunctionType(IInvocableType funcType, List<? extends IExpression> eArgs, boolean bUseCtx, TypeVarToTypeMap inferenceMap) -
inferConstructor
-
inferFunction
private IInvocableType inferFunction(IInvocableType funcType, List<? extends IExpression> eArgs, boolean bUseCtx, TypeVarToTypeMap inferenceMap) -
getPropertyNameFromMethodName
-
getPropertyNameFromMethodNameIncludingSetter
-
getPropertyNameFromMethodName
-
verifyPropertyWritable
private void verifyPropertyWritable(IType classRoot, String strProperty, boolean bFromObjInitializer) throws ParseException - Throws:
ParseException
-
getConstructorType
public IConstructorType getConstructorType(IType classBean, Expression[] eArgs, List<IConstructorType> listAllMatchingMethods, ParserBase parserState) throws ParseException Get the type of the method specified in the member path.- Parameters:
classBean- The declaring class of the constructor.parserState- The parserState that may be involved in the process of parsing a constructor. Can be null.- Returns:
- A Gosu type for the constructor.
- Throws:
ParseException
-
verifyCase
private void verifyCase(ParsedElement element, String foundName, String actualName, ResourceKey errorKey, boolean isEndsWithMatchOK) -
verifyCase
private void verifyCase(ParsedElement element, String foundName, String actualName, IParserState state, ResourceKey errorKey, boolean isEndsWithMatchOK) -
setWarnOnCaseIssue
public void setWarnOnCaseIssue(boolean warnOnCaseIssue) - Specified by:
setWarnOnCaseIssuein interfaceIGosuParser
-
setEditorParser
public void setEditorParser(boolean bStudioEditorParser) - Specified by:
setEditorParserin interfaceIGosuParser
-
isEditorParser
public boolean isEditorParser()- Specified by:
isEditorParserin interfaceIGosuParser
-
getState
- Specified by:
getStatein interfaceIGosuParser
-
isParsingAnnotation
public boolean isParsingAnnotation() -
setParsingAnnotation
public void setParsingAnnotation(boolean parsingAnnotation) -
isAllowingWildcards
public boolean isAllowingWildcards() -
setAllowWildcards
public void setAllowWildcards(boolean allowWildcards) -
isIgnoreTypeDeprecation
public boolean isIgnoreTypeDeprecation() -
pushIgnoreTypeDeprecation
public void pushIgnoreTypeDeprecation() -
popIgnoreTypeDeprecation
public void popIgnoreTypeDeprecation() -
setLocationsFromProgramClassParser
-
maybeAdvanceTokenizerToEndOfSavedLocation
boolean maybeAdvanceTokenizerToEndOfSavedLocation() -
pushTypeVariableTypesToInfer
-
addTypeVarsToList
-
toString
-