public interface IGosuParser extends IParserPart
| Modifier and Type | Interface and Description |
|---|---|
static class |
IGosuParser.ParseType |
static class |
IGosuParser.Settings |
| Modifier and Type | Field and Description |
|---|---|
static BigDecimal |
BIGD_ZERO |
static Double[] |
DOUBLE_DIGITS |
static Double |
NaN |
static Double |
ONE |
static Double |
ZERO |
| Modifier and Type | Method and Description |
|---|---|
Map<String,List<IFunctionSymbol>> |
getDfsDecls() |
List<IParseTree> |
getLocations() |
IScriptPartId |
getScriptPart()
The context associated with the parser's script.
|
IParserState |
getState() |
ISymbolTable |
getSymbolTable()
Returns the parser's symbol table.
|
ISourceCodeTokenizer |
getTokenizer() |
ITokenizerInstructor |
getTokenizerInstructor()
The TokenizerInstructor to use for this parser.
|
ITypeUsesMap |
getTypeUsesMap()
Get the type uses map.
|
Map<String,ITypeVariableDefinition> |
getTypeVariables() |
boolean |
hasWarnings() |
boolean |
isCaptureSymbolsForEval() |
boolean |
isEditorParser() |
boolean |
isParsed() |
boolean |
isParsingBlock() |
boolean |
isParsingFunction() |
boolean |
isThrowParseResultsExceptionForWarnings() |
IGosuClass |
parseClass(String strQualifiedClassName,
ISourceFileHandle sourceFile,
boolean bThrowOnWarnings,
boolean bFullyCompile)
For use by code editors etc.
|
IExpression |
parseExp(IScriptPartId partId)
Parses a Gosu expression.
|
IExpression |
parseExp(IScriptPartId partId,
IType expectedExpressionType)
Parses a Gosu expression.
|
IExpression |
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.
|
ArrayList<ISymbol> |
parseParameterDeclarationList(IParsedElement pe,
boolean bStatic,
List<IType> inferredArgumentTypes) |
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) |
IStatement |
parseStatements(IScriptPartId partId)
Parses a set of Gosu statements.
|
boolean |
parseTypeLiteral()
Consumes a type literal from the current tokenizer, if one exists.
|
ITypeLiteralExpression |
parseTypeLiteral(IScriptPartId partId)
Parses a type literal expression.
|
IUsesStatementList |
parseUsesStatementList(boolean resolveTypes) |
IExpression |
popExpression() |
void |
putDfsDeclInSetByName(IDynamicFunctionSymbol specialFunction) |
void |
putDfsDeclsInTable(ISymbolTable table) |
ITypeLiteralExpression |
resolveTypeLiteral(String strName) |
void |
setCaptureSymbolsForEval(boolean bCaputreSymbolsForEval) |
void |
setDfsDeclInSetByName(Map<String,List<IFunctionSymbol>> dfsDecl) |
void |
setEditorParser(boolean bEditorParser) |
void |
setGenerateRootExpressionAccessForProgram(boolean bGenRootExprAccess) |
void |
setIgnoreWarnings(Set<ResourceKey> ignoreWarnings) |
void |
setScript(CharSequence strRule)
Set the script or expression to parse and execute.
|
void |
setScript(ISource reader)
Set the script or expression to parse and execute.
|
void |
setScript(SourceCodeReader reader)
Set the script or expression to parse and execute.
|
void |
setSnapshotSymbols() |
void |
setSymbolTable(ISymbolTable symTable)
Sets the parser's symbol table.
|
void |
setThrowParseExceptionForWarnings(boolean bThrowParseExceptionForWarnings) |
void |
setTokenizer(ISourceCodeTokenizer tokenizer) |
void |
setTokenizerInstructor(ITokenizerInstructor instructor) |
void |
setTypeUsesMap(ITypeUsesMap typeUsesMap)
Set the type uses map.
|
void |
setWarnOnCaseIssue(boolean warnOnCaseIssue) |
eatBlock, eatBlock, getLineNumShift, getOffsetShift, getOwner, isDontOptimizeStatementLists, match, matchDeclarationKeyword, setDontOptimizeStatementLists, setLineNumShift, setValidatorstatic final Double NaN
static final Double ZERO
static final Double ONE
static final Double[] DOUBLE_DIGITS
static final BigDecimal BIGD_ZERO
IScriptPartId getScriptPart()
void setScript(CharSequence strRule)
strRule - The rule (Gosu) source to parse/execute.void setScript(SourceCodeReader reader)
reader - A reader for the rule (Gosu) source to parse/execute.void setScript(ISource reader)
reader - A reader for the rule (Gosu) source to parse/execute.ISymbolTable getSymbolTable()
void setSymbolTable(ISymbolTable symTable)
symTable - The symbol table the parser will use when parsing and executing rules.ITypeUsesMap getTypeUsesMap()
void setTypeUsesMap(ITypeUsesMap typeUsesMap)
IStatement parseStatements(IScriptPartId partId) throws ParseResultsException
ParseResultsException - if any of the statements do not parse according to the Gosu grammar.IProgram parseProgram(IScriptPartId partId) throws ParseResultsException
ParseResultsExceptionIProgram parseProgram(IScriptPartId partId, IType expectedExpressionType) throws ParseResultsException
ParseResultsExceptionIProgram parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) throws ParseResultsException
ParseResultsExceptionIProgram parseProgram(IScriptPartId partId, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException) throws ParseResultsException
ParseResultsExceptionIProgram parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime) throws ParseResultsException
ParseResultsExceptionIProgram parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException) throws ParseResultsException
ParseResultsExceptionIProgram parseProgram(IScriptPartId partId, boolean isolatedScope, boolean reallyIsolatedScope, IType expectedExpressionType, IFileContext ctx, boolean assignRuntime, boolean bDoNotThrowParseResultsException, IType superType) throws ParseResultsException
ParseResultsExceptionIGosuClass parseClass(String strQualifiedClassName, ISourceFileHandle sourceFile, boolean bThrowOnWarnings, boolean bFullyCompile) throws ParseResultsException
ParseResultsExceptionIExpression parseExp(IScriptPartId partId) throws ParseResultsException
ParseResultsException - if the expression does not parse according to the Gosu grammar.IExpression parseExp(IScriptPartId partId, IType expectedExpressionType) throws ParseResultsException
ParseResultsException - if the expression does not parse according to the Gosu grammar.IExpression parseExp(IScriptPartId partId, IType expectedExpressionType, IFileContext context, boolean assignRuntime) throws ParseResultsException
ParseResultsException - if the expression does not parse according to the Gosu grammar.IExpression parseExpOrProgram(IScriptPartId partId) throws ParseResultsException
partId - Script part idParseResultsException - 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 IParseResultsExceptionIExpression parseExpOrProgram(IScriptPartId partId, boolean isolatedScope, boolean assignRuntime) throws ParseResultsException
partId - Script part idisolatedScope - if false, the program will modify the symbol table at the current scopeParseResultsException - 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 IParseResultsExceptionITypeLiteralExpression parseTypeLiteral(IScriptPartId partId) throws ParseResultsException
ParseResultsExceptionboolean parseTypeLiteral()
boolean isParsed()
boolean hasWarnings()
List<IParseTree> getLocations()
ITokenizerInstructor getTokenizerInstructor()
void setTokenizerInstructor(ITokenizerInstructor instructor)
Map<String,ITypeVariableDefinition> getTypeVariables()
boolean isThrowParseResultsExceptionForWarnings()
void setThrowParseExceptionForWarnings(boolean bThrowParseExceptionForWarnings)
void setWarnOnCaseIssue(boolean warnOnCaseIssue)
void setEditorParser(boolean bEditorParser)
boolean isEditorParser()
void putDfsDeclsInTable(ISymbolTable table)
ISourceCodeTokenizer getTokenizer()
ArrayList<ISymbol> parseParameterDeclarationList(IParsedElement pe, boolean bStatic, List<IType> inferredArgumentTypes)
void putDfsDeclInSetByName(IDynamicFunctionSymbol specialFunction)
ITypeLiteralExpression resolveTypeLiteral(String strName)
Map<String,List<IFunctionSymbol>> getDfsDecls()
IParserState getState()
boolean isCaptureSymbolsForEval()
void setCaptureSymbolsForEval(boolean bCaputreSymbolsForEval)
void setDfsDeclInSetByName(Map<String,List<IFunctionSymbol>> dfsDecl)
boolean isParsingFunction()
boolean isParsingBlock()
IProgram parseProgram(IScriptPartId partId, boolean isolatedScope, IType expectedExpressionType) throws ParseResultsException
ParseResultsExceptionvoid setGenerateRootExpressionAccessForProgram(boolean bGenRootExprAccess)
void setSnapshotSymbols()
IUsesStatementList parseUsesStatementList(boolean resolveTypes)
IExpression popExpression()
void setTokenizer(ISourceCodeTokenizer tokenizer)
void setIgnoreWarnings(Set<ResourceKey> ignoreWarnings)
Copyright © 2019. All rights reserved.