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
public final class GosuParser extends ParserBase implements IGosuParser
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gw.lang.parser.IGosuParser
IGosuParser.ParseType, IGosuParser.Settings
-
-
Field Summary
Fields Modifier and Type Field Description static ErrorType
notfound
static IType
PENDING_BOUNDING_TYPE
-
Fields inherited from class gw.internal.gosu.parser.ParserBase
_bDontOptimizeStatementLists, _offsetShift
-
Fields inherited from interface gw.lang.parser.IGosuParser
BIGD_ZERO, DOUBLE_DIGITS, NaN, ONE, ZERO
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clearDfsStack()
boolean
doParametersReifyToSameBytecodeType(IDynamicFunctionSymbol dfs, IDynamicFunctionSymbol dfsExisting)
static IType
findImpl(IType typeToInit)
IConstructorType
getConstructorType(IType classBean, Expression[] eArgs, List<IConstructorType> listAllMatchingMethods, ParserBase parserState)
Get the type of the method specified in the member path.ContextType
getContextType()
Map<String,List<IFunctionSymbol>>
getDfsDecls()
protected List<IFunctionSymbol>
getDfsDeclsForFunction(String strFunctionName)
IFunctionType
getFunctionType(IType classBean, String functionName, Expression[] eArgs, List<IFunctionType> listAllMatchingMethods, GosuParser parser, boolean bMatchParamTypes)
protected List<IFunctionType>
getFunctionTypesForName(String strFunctionName)
TypeVarToTypeMap
getInferenceMap()
List<IParseTree>
getLocations()
String
getNamespace()
protected String
getScript()
IScriptPartId
getScriptPart()
The context associated with the parser's script.Stack<IScriptPartId>
getScriptPartIdStack()
IParserState
getState()
ISymbolTable
getSymbolTable()
Returns the parser's symbol table.SourceCodeTokenizer
getTokenizer()
ITokenizerInstructor
getTokenizerInstructor()
The TokenizerInstructor to use for this parser.ITypeUsesMap
getTypeUsesMap()
Get the type uses map.HashMap<String,ITypeVariableDefinition>
getTypeVariables()
IScriptabilityModifier
getVisibilityConstraint()
boolean
hasWarnings()
boolean
isAllowingWildcards()
boolean
isCaptureSymbolsForEval()
boolean
isEditorParser()
boolean
isGenerateRootExpressionAccessForProgram()
boolean
isIgnoreTypeDeprecation()
boolean
isParsed()
boolean
isParsingAbstractConstructor()
boolean
isParsingAnnotation()
boolean
isParsingFieldInitializer()
boolean
isParsingFunction()
boolean
isParsingStaticFeature()
boolean
isThrowParseResultsExceptionForWarnings()
Iterator<FunctionType>
iterateParsingFunctions()
protected void
newDfsDeclInSetByName()
int
nextIndexOfErrantDuplicateDynamicSymbol(IDynamicSymbol ds, Collection<? extends ISymbol> symbols, boolean bCheckContains)
IGosuClassInternal
parseClass(String strQualifiedClassName, ISourceFileHandle sourceFile, boolean bThrowOnWarnings, boolean bFullyCompile)
For use by code editors etc.Expression
parseExp(IScriptPartId partId)
Parses a Gosu expression.Expression
parseExp(IScriptPartId partId, IType expectedExpressionType)
Parses a Gosu expression.Expression
parseExp(IScriptPartId partId, IType expectedExpressionType, IFileContext context, boolean assignRuntime)
Parses a Gosu expression.IExpression
parseExpOrProgram(IScriptPartId partId)
Parses a Gosu expression.IExpression
parseExpOrProgram(IScriptPartId partId, boolean isolatedScope, boolean assignRuntime)
Parses a Gosu expression.IExpression
parseExpOrProgram(IScriptPartId partId, IType typeExpected, boolean isolatedScope, boolean assignRuntime)
ArrayList<ISymbol>
parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes)
ArrayList<ISymbol>
parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes, boolean bProperty, boolean bGetter, boolean bEmpty, boolean bVarDynamicArg)
IProgram
parseProgram(IScriptPartId partId)
IProgram
parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime)
IProgram
parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException)
IProgram
parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException, IType superType)
IProgram
parseProgram(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType)
IProgram
parseProgram(IScriptPartId partId, IType expectedExpressionType)
IProgram
parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime)
IProgram
parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException)
Statement
parseStatements(IScriptPartId partId)
Parses a set of Gosu statements.boolean
parseTypeLiteral()
Consumes a type literal from the current tokenizer, if one exists.boolean
parseTypeLiteral(Token token)
TypeLiteral
parseTypeLiteral(IScriptPartId partId)
Parses a type literal expression.UsesStatementList
parseUsesStatementList(boolean bResolveUsesTypes)
protected DynamicFunctionSymbol
peekDynamicFunctionSymbol()
protected Expression
peekExpression()
ParseTree
peekLocation()
protected ParsedElement
peekParsedElement()
VarStatement
peekParsingFieldInitializer()
FunctionType
peekParsingFunction()
protected Statement
peekStatement()
protected DynamicFunctionSymbol
popDynamicFunctionSymbol()
Expression
popExpression()
void
popIgnoreTypeDeprecation()
void
popInferredContextTypes()
void
popParsingAbstractConstructor()
void
popParsingStaticMember()
protected Statement
popStatement()
protected void
pushDynamicFunctionSymbol(DynamicFunctionSymbol stmt)
protected void
pushExpression(Expression e)
void
pushIgnoreTypeDeprecation()
void
pushInferenceMap(TypeVarToTypeMap inferenceMap)
void
pushInferredContextTypes(ContextType ctxType)
void
pushParsingAbstractConstructor(Boolean bParsingAbstractConstructor)
void
pushParsingStaticMember(Boolean bParsingStaticFeature)
void
pushScriptPart(IScriptPartId partId)
protected void
pushStatement(Statement stmt)
protected void
pushTypeVariableTypesToInfer(IInvocableType functionType)
void
putDfsDeclInSetByName(IDynamicFunctionSymbol dfs)
void
putDfsDeclsInTable(ISymbolTable table)
void
resetScript()
TypeLiteral
resolveTypeLiteral(String strTypeName)
Resolves the type literal given by strTypeName.protected TypeLiteral
resolveTypeLiteral(String[] T)
protected TypeLiteral
resolveTypeLiteral(String[] T, boolean bRelative, boolean bInterface)
TypeLiteral
resolveTypeLiteral(String strTypeName, boolean bRelative, boolean bInterface)
void
setAllowWildcards(boolean allowWildcards)
void
setCaptureSymbolsForEval(boolean bCaputreSymbolsForEval)
void
setContextInferenceManager(ContextInferenceManager ctxInferenceMgr)
void
setDfsDeclInSetByName(Map<String,List<IFunctionSymbol>> dfsDecl)
void
setEditorParser(boolean bStudioEditorParser)
void
setGenerateRootExpressionAccessForProgram(boolean bGenRootExprAccess)
void
setLocationsFromProgramClassParser(List<ParseTree> savedLocations)
protected void
setParsed(boolean bParsed)
void
setParsingAnnotation(boolean parsingAnnotation)
void
setScript(ISource src)
Set the script or expression to parse and execute.void
setScript(SourceCodeReader reader)
Set the script or expression to parse and execute.void
setScript(CharSequence source)
Set the script or expression to parse and execute.void
setSymbolTable(ISymbolTable symTable)
Sets the parser's symbol table.void
setThrowParseExceptionForWarnings(boolean bThrowParseExceptionForWarnings)
void
setTokenizer(ISourceCodeTokenizer tokenizer)
void
setTokenizerInstructor(ITokenizerInstructor tokenizerInstructor)
void
setTypeUsesMap(ITypeUsesMap typeUsesMap)
Set the type uses map.protected void
setTypeVariables(HashMap<String,ITypeVariableDefinition> map)
void
setValidator(IGosuValidator validator)
void
setWarnOnCaseIssue(boolean warnOnCaseIssue)
String
toString()
boolean
typeVarExists(Map<String,ITypeVariableDefinition> typeVarMap, TypeVariableDefinition typeVarDef)
-
Methods inherited from class gw.internal.gosu.parser.ParserBase
addBlockToBlockStack, captureAllSymbols, captureSymbol, copyBlockStackTo, eatBlock, eatBlock, eatOptionalSemiColon, eatTypeLiteral, findAndWrapLocation, findMathOpMethod, getCurrentEnclosingGosuClass, getCurrentlyInferringFunctionTypeVars, getLineNumShift, getOffsetShift, getOwner, getParsingAnonymousClass, getUncapturedSymbol, getValidator, isDontOptimizeStatementLists, isEvalClass, isParsingBlock, match, match, match, match, match, matchDeclarationKeyword, parseAnnotation, parseDotPathWord, peekInferringFunctionTypeVariableTypes, popInferringFunctionTypeVariableTypes, possiblyWrapWithCoercion, possiblyWrapWithImplicitCoercion, pushCurrentBlock, pushInferringFunctionTypeVars, resolveNamespace, resolveNamespaceSymbol, resolveRuntimeType, resolveSymbol, resolveType, resolveType, resolveTypeForArithmeticExpression, setBlocks, setDontOptimizeStatementLists, setIgnoreWarnings, setLineNumShift, setLocationForImplicitTypeAs, setOffsetShift, setOwner, setSnapshotSymbols, setSubTree, shouldSnapshotSymbols, verifyComparable, verifyComparable, verifyComparable, verifyModifiersForFeature, verifyNonVoidExpression, verifyParsedElement, verifyParsedElement, verifyTypesComparable, verifyTypesComparable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.parser.IGosuParser
isParsingBlock, setIgnoreWarnings, setSnapshotSymbols
-
Methods inherited from interface gw.lang.parser.IParserPart
getLineNumShift, getOffsetShift, getOwner, isDontOptimizeStatementLists, setDontOptimizeStatementLists, setLineNumShift
-
-
-
-
Method Detail
-
setValidator
public void setValidator(IGosuValidator validator)
- Specified by:
setValidator
in interfaceIParserPart
- Overrides:
setValidator
in classParserBase
-
getScriptPart
public IScriptPartId getScriptPart()
Description copied from interface:IGosuParser
The context associated with the parser's script. E.g., a file name, a library, a rule, etc.- Specified by:
getScriptPart
in interfaceIGosuParser
-
getScriptPartIdStack
public Stack<IScriptPartId> getScriptPartIdStack()
-
pushScriptPart
public void pushScriptPart(IScriptPartId partId)
-
getInferenceMap
public TypeVarToTypeMap getInferenceMap()
-
pushInferenceMap
public void pushInferenceMap(TypeVarToTypeMap inferenceMap)
-
setScript
public void setScript(CharSequence source)
Description copied from interface:IGosuParser
Set the script or expression to parse and execute.- Specified by:
setScript
in interfaceIGosuParser
- Parameters:
source
- The rule (Gosu) source to parse/execute.
-
setScript
public void setScript(ISource src)
Description copied from interface:IGosuParser
Set the script or expression to parse and execute.- Specified by:
setScript
in interfaceIGosuParser
- Parameters:
src
- A reader for the rule (Gosu) source to parse/execute.
-
setScript
public void setScript(SourceCodeReader reader)
Description copied from interface:IGosuParser
Set the script or expression to parse and execute.- Specified by:
setScript
in interfaceIGosuParser
- Parameters:
reader
- A reader for the rule (Gosu) source to parse/execute.
-
resetScript
public void resetScript()
-
getScript
protected String getScript()
- Specified by:
getScript
in classParserBase
-
getSymbolTable
public ISymbolTable getSymbolTable()
Description copied from interface:IGosuParser
Returns the parser's symbol table.- Specified by:
getSymbolTable
in interfaceIGosuParser
-
setSymbolTable
public void setSymbolTable(ISymbolTable symTable)
Description copied from interface:IGosuParser
Sets the parser's symbol table.- Specified by:
setSymbolTable
in interfaceIGosuParser
- Parameters:
symTable
- The symbol table the parser will use when parsing and executing rules.
-
getTypeUsesMap
public ITypeUsesMap getTypeUsesMap()
Description copied from interface:IGosuParser
Get the type uses map.- Specified by:
getTypeUsesMap
in interfaceIGosuParser
-
setTypeUsesMap
public void setTypeUsesMap(ITypeUsesMap typeUsesMap)
Description copied from interface:IGosuParser
Set the type uses map.- Specified by:
setTypeUsesMap
in interfaceIGosuParser
-
getNamespace
public String getNamespace()
-
getVisibilityConstraint
public IScriptabilityModifier getVisibilityConstraint()
-
getTokenizerInstructor
public ITokenizerInstructor getTokenizerInstructor()
Description copied from interface:IGosuParser
The TokenizerInstructor to use for this parser. Optional.- Specified by:
getTokenizerInstructor
in interfaceIGosuParser
-
setTokenizerInstructor
public void setTokenizerInstructor(ITokenizerInstructor tokenizerInstructor)
- Specified by:
setTokenizerInstructor
in interfaceIGosuParser
-
peekParsingFunction
public FunctionType peekParsingFunction()
-
iterateParsingFunctions
public Iterator<FunctionType> iterateParsingFunctions()
-
isParsingFunction
public boolean isParsingFunction()
- Specified by:
isParsingFunction
in interfaceIGosuParser
-
peekParsingFieldInitializer
public VarStatement peekParsingFieldInitializer()
-
isParsingFieldInitializer
public boolean isParsingFieldInitializer()
-
parseStatements
public Statement parseStatements(IScriptPartId partId) throws ParseResultsException
Description copied from interface:IGosuParser
Parses a set of Gosu statements. To execute all of the Statements at once call Statement.execute().- Specified by:
parseStatements
in interfaceIGosuParser
- Returns:
- The parsed Statement[s].
- Throws:
ParseResultsException
- if any of the statements do not parse according to the Gosu grammar.
-
parseProgram
public IProgram parseProgram(IScriptPartId partId) throws ParseResultsException
- Specified by:
parseProgram
in interfaceIGosuParser
- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, IType expectedExpressionType) throws ParseResultsException
- Specified by:
parseProgram
in interfaceIGosuParser
- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) throws ParseResultsException
- Specified by:
parseProgram
in interfaceIGosuParser
- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException) throws ParseResultsException
- Specified by:
parseProgram
in interfaceIGosuParser
- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType) throws ParseResultsException
- Specified by:
parseProgram
in interfaceIGosuParser
- Throws:
ParseResultsException
-
parseProgram
public IProgram parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) throws ParseResultsException
- Specified by:
parseProgram
in 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:
parseProgram
in 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:
parseProgram
in interfaceIGosuParser
- Throws:
ParseResultsException
-
setGenerateRootExpressionAccessForProgram
public void setGenerateRootExpressionAccessForProgram(boolean bGenRootExprAccess)
- Specified by:
setGenerateRootExpressionAccessForProgram
in interfaceIGosuParser
-
isGenerateRootExpressionAccessForProgram
public boolean isGenerateRootExpressionAccessForProgram()
-
parseExp
public Expression parseExp(IScriptPartId partId) throws ParseResultsException
Description copied from interface:IGosuParser
Parses a Gosu expression. To evaluate the Expression simply call Expression.evaluate().- Specified by:
parseExp
in 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:IGosuParser
Parses a Gosu expression. To evaluate the Expression simply call Expression.evaluate().- Specified by:
parseExp
in 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:IGosuParser
Parses a Gosu expression. To evaluate the Expression simply call Expression.evaluate().- Specified by:
parseExp
in interfaceIGosuParser
- Returns:
- The parsed Expression.
- Throws:
ParseResultsException
- if the expression does not parse according to the Gosu grammar.
-
parseExpOrProgram
public IExpression parseExpOrProgram(IScriptPartId partId) throws ParseResultsException
Description copied from interface:IGosuParser
Parses 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:
parseExpOrProgram
in 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:IGosuParser
Parses 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:
parseExpOrProgram
in 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
public TypeLiteral parseTypeLiteral(IScriptPartId partId) throws ParseResultsException
Description copied from interface:IGosuParser
Parses a type literal expression. The source must obviously satisfy the type literal syntax.- Specified by:
parseTypeLiteral
in interfaceIGosuParser
- Throws:
ParseResultsException
-
isParsed
public boolean isParsed()
- Specified by:
isParsed
in interfaceIGosuParser
- Returns:
- Whether or not the referenced Gosu source has been parsed.
-
setParsed
protected void setParsed(boolean bParsed)
-
getTokenizer
public final SourceCodeTokenizer getTokenizer()
- Specified by:
getTokenizer
in interfaceIGosuParser
-
getLocations
public List<IParseTree> getLocations()
- Specified by:
getLocations
in interfaceIGosuParser
- Returns:
- All the locations corresponding to parsed elements.
-
peekLocation
public ParseTree peekLocation()
-
hasWarnings
public boolean hasWarnings()
- Specified by:
hasWarnings
in interfaceIGosuParser
- Returns:
- Did the most recent parse have warnings
-
isThrowParseResultsExceptionForWarnings
public boolean isThrowParseResultsExceptionForWarnings()
- Specified by:
isThrowParseResultsExceptionForWarnings
in interfaceIGosuParser
-
setThrowParseExceptionForWarnings
public void setThrowParseExceptionForWarnings(boolean bThrowParseExceptionForWarnings)
- Specified by:
setThrowParseExceptionForWarnings
in interfaceIGosuParser
-
setContextInferenceManager
public void setContextInferenceManager(ContextInferenceManager ctxInferenceMgr)
-
pushInferredContextTypes
public void pushInferredContextTypes(ContextType ctxType)
-
popInferredContextTypes
public void popInferredContextTypes()
-
getContextType
public ContextType getContextType()
-
isCaptureSymbolsForEval
public boolean isCaptureSymbolsForEval()
- Specified by:
isCaptureSymbolsForEval
in interfaceIGosuParser
-
setCaptureSymbolsForEval
public void setCaptureSymbolsForEval(boolean bCaputreSymbolsForEval)
- Specified by:
setCaptureSymbolsForEval
in interfaceIGosuParser
-
isParsingStaticFeature
public boolean isParsingStaticFeature()
-
pushParsingStaticMember
public void pushParsingStaticMember(Boolean bParsingStaticFeature)
-
popParsingStaticMember
public void popParsingStaticMember()
-
isParsingAbstractConstructor
public boolean isParsingAbstractConstructor()
-
pushParsingAbstractConstructor
public void pushParsingAbstractConstructor(Boolean bParsingAbstractConstructor)
-
popParsingAbstractConstructor
public void popParsingAbstractConstructor()
-
parseTypeLiteral
public boolean parseTypeLiteral()
Description copied from interface:IGosuParser
Consumes a type literal from the current tokenizer, if one exists.- Specified by:
parseTypeLiteral
in interfaceIGosuParser
- Returns:
- true if a type literal was found, false otherwise
-
parseTypeLiteral
public boolean parseTypeLiteral(Token token)
-
parseUsesStatementList
public UsesStatementList parseUsesStatementList(boolean bResolveUsesTypes)
- Specified by:
parseUsesStatementList
in interfaceIGosuParser
-
doParametersReifyToSameBytecodeType
public boolean doParametersReifyToSameBytecodeType(IDynamicFunctionSymbol dfs, IDynamicFunctionSymbol dfsExisting)
-
parseParameterDeclarationList
public ArrayList<ISymbol> parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes)
- Specified by:
parseParameterDeclarationList
in interfaceIGosuParser
-
parseParameterDeclarationList
public ArrayList<ISymbol> parseParameterDeclarationList(IParsedElement element, boolean bStatic, List<IType> inferredArgumentTypes, boolean bProperty, boolean bGetter, boolean bEmpty, boolean bVarDynamicArg)
-
typeVarExists
public boolean typeVarExists(Map<String,ITypeVariableDefinition> typeVarMap, TypeVariableDefinition typeVarDef)
-
pushExpression
protected void pushExpression(Expression e)
- Overrides:
pushExpression
in classParserBase
-
popExpression
public Expression popExpression()
- Specified by:
popExpression
in interfaceIGosuParser
- Overrides:
popExpression
in classParserBase
-
setTokenizer
public void setTokenizer(ISourceCodeTokenizer tokenizer)
- Specified by:
setTokenizer
in interfaceIGosuParser
-
peekExpression
protected Expression peekExpression()
- Overrides:
peekExpression
in classParserBase
-
peekParsedElement
protected ParsedElement peekParsedElement()
-
pushStatement
protected void pushStatement(Statement stmt)
- Overrides:
pushStatement
in classParserBase
-
popStatement
protected Statement popStatement()
- Overrides:
popStatement
in classParserBase
-
peekStatement
protected Statement peekStatement()
- Overrides:
peekStatement
in classParserBase
-
pushDynamicFunctionSymbol
protected void pushDynamicFunctionSymbol(DynamicFunctionSymbol stmt)
-
popDynamicFunctionSymbol
protected DynamicFunctionSymbol popDynamicFunctionSymbol()
-
peekDynamicFunctionSymbol
protected DynamicFunctionSymbol peekDynamicFunctionSymbol()
-
clearDfsStack
protected void clearDfsStack()
-
putDfsDeclsInTable
public void putDfsDeclsInTable(ISymbolTable table)
- Specified by:
putDfsDeclsInTable
in interfaceIGosuParser
-
putDfsDeclInSetByName
public void putDfsDeclInSetByName(IDynamicFunctionSymbol dfs)
- Specified by:
putDfsDeclInSetByName
in interfaceIGosuParser
-
nextIndexOfErrantDuplicateDynamicSymbol
public int nextIndexOfErrantDuplicateDynamicSymbol(IDynamicSymbol ds, Collection<? extends ISymbol> symbols, boolean bCheckContains)
-
setDfsDeclInSetByName
public void setDfsDeclInSetByName(Map<String,List<IFunctionSymbol>> dfsDecl)
- Specified by:
setDfsDeclInSetByName
in interfaceIGosuParser
-
newDfsDeclInSetByName
protected void newDfsDeclInSetByName()
-
getDfsDecls
public Map<String,List<IFunctionSymbol>> getDfsDecls()
- Specified by:
getDfsDecls
in interfaceIGosuParser
-
getFunctionTypesForName
protected List<IFunctionType> getFunctionTypesForName(String strFunctionName)
-
resolveTypeLiteral
protected TypeLiteral resolveTypeLiteral(String[] T)
-
resolveTypeLiteral
protected TypeLiteral resolveTypeLiteral(String[] T, boolean bRelative, boolean bInterface)
-
getDfsDeclsForFunction
protected List<IFunctionSymbol> getDfsDeclsForFunction(String strFunctionName)
-
resolveTypeLiteral
public TypeLiteral resolveTypeLiteral(String strTypeName)
Resolves the type literal given by strTypeName. If parentType is non null then strTypeName is assumed relative to the given parent.- Specified by:
resolveTypeLiteral
in interfaceIGosuParser
- Parameters:
strTypeName
-
-
resolveTypeLiteral
public TypeLiteral resolveTypeLiteral(String strTypeName, boolean bRelative, boolean bInterface)
-
getTypeVariables
public HashMap<String,ITypeVariableDefinition> getTypeVariables()
- Specified by:
getTypeVariables
in interfaceIGosuParser
-
setTypeVariables
protected void setTypeVariables(HashMap<String,ITypeVariableDefinition> map)
-
parseClass
public IGosuClassInternal parseClass(String strQualifiedClassName, ISourceFileHandle sourceFile, boolean bThrowOnWarnings, boolean bFullyCompile) throws ParseResultsException
Description copied from interface:IGosuParser
For use by code editors etc.- Specified by:
parseClass
in interfaceIGosuParser
- Throws:
ParseResultsException
-
getFunctionType
public IFunctionType getFunctionType(IType classBean, String functionName, Expression[] eArgs, List<IFunctionType> listAllMatchingMethods, GosuParser parser, boolean bMatchParamTypes) 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
-
setWarnOnCaseIssue
public void setWarnOnCaseIssue(boolean warnOnCaseIssue)
- Specified by:
setWarnOnCaseIssue
in interfaceIGosuParser
-
setEditorParser
public void setEditorParser(boolean bStudioEditorParser)
- Specified by:
setEditorParser
in interfaceIGosuParser
-
isEditorParser
public boolean isEditorParser()
- Specified by:
isEditorParser
in interfaceIGosuParser
-
getState
public IParserState getState()
- Specified by:
getState
in 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
public void setLocationsFromProgramClassParser(List<ParseTree> savedLocations)
-
pushTypeVariableTypesToInfer
protected void pushTypeVariableTypesToInfer(IInvocableType functionType)
-
-