Class Program
java.lang.Object
gw.internal.gosu.parser.ParsedElement
gw.internal.gosu.parser.Expression
gw.internal.gosu.parser.expressions.Program
- All Implemented Interfaces:
IProgram,IExpression,IHasType,IParsedElement
An expression representing a Program:
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ITypeprivate Map<String,IDynamicFunctionSymbol> private StatementFields inherited from class gw.internal.gosu.parser.Expression
_typeFields inherited from class gw.internal.gosu.parser.ParsedElement
_tokens, UNDEF_FILE, UNDEF_FUNCTION, UNDEF_MODULEFields inherited from interface gw.lang.parser.IExpression
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParseWarning(IParseIssue warning) evaluate()Evaluates this Expression and returns the result.findDeclaringStatement(IParsedElement element, String identifierName) <E extends IParsedElement>
booleangetContainedParsedElementsByType(Class<E> parsedElementType, List<E> listResults) Find all the parsed elements of a given type contained within this parsed element.booleanbooleanbooleanvoidsetDeclaredReturnType(IType declaredReturnType) voidsetFunctions(Map functions) voidsetMainStatement(Statement mainStatement) toString()Subclasses should return a String representing the parsed expression.Methods inherited from class gw.internal.gosu.parser.Expression
evaluate, getContextType, getType, getTypeImpl, isNullSafe, isUnchecked, setTypeMethods inherited from class gw.internal.gosu.parser.ParsedElement
addExceptionsFrom, addParseException, addParseException, addParseException, addParseExceptions, addParseIssues, addParseWarning, addParseWarnings, addToken, adjustColumn, adjustLineNum, assignTokens, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, compactParseTree, findAncestorParsedElementByType, findLineNumberOfDeclaration, findRootParsedElement, getAnnotations, getColumn, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getEnclosingFeatureInfo, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getLineNum, getModule, getParent, getQualifyingEnclosingTypeInfo, getTokens, hasImmediateParseIssue, hasImmediateParseWarning, hasImmediateParseWarnings, hasParseException, hasParseIssue, hasParseIssues, hasParseWarning, initEmptyParseTree, initLocation, isCompileTimeConstant, isSuppressed, isSuppressed, isSynthetic, makeDoubleValue, makeFloatValue, makeInteger, makeLong, removeParseException, removeParseWarning, removeParseWarningRecursively, setGosuProgram, setLineNum, setLocation, setParent, setSynthetic, shouldClearParseInfo, visitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gw.lang.parser.IExpression
evaluate, getContextType, isNullSafe, isUncheckedMethods inherited from interface gw.lang.parser.IParsedElement
addExceptionsFrom, addParseException, addParseException, addParseWarning, clearParseExceptions, clearParseTreeInformation, clearParseWarnings, findAncestorParsedElementByType, findRootParsedElement, getColumn, getContainedParsedElementsByTypes, getContainedParsedElementsByTypesWithIgnoreSet, getFunctionName, getGosuClass, getGosuProgram, getImmediateParseIssue, getLineNum, getModule, getParent, getTokens, hasImmediateParseIssue, hasImmediateParseWarnings, hasParseException, hasParseIssue, hasParseIssues, hasParseWarning, isCompileTimeConstant, isSuppressed, isSynthetic, setLocation, setParent, visit
-
Field Details
-
_mainStatement
-
_functions
-
_declaredReturnType
-
-
Constructor Details
-
Program
public Program()Constructs a Program given an ISymbolTable instance.
-
-
Method Details
-
getMainStatement
- Specified by:
getMainStatementin interfaceIProgram
-
setMainStatement
-
getFunctions
- Specified by:
getFunctionsin interfaceIProgram
-
setFunctions
-
getDeclaredReturnType
-
setDeclaredReturnType
-
evaluate
Description copied from interface:IExpressionEvaluates this Expression and returns the result.- Specified by:
evaluatein interfaceIExpression- Overrides:
evaluatein classExpression
-
addParseWarning
- Specified by:
addParseWarningin interfaceIParsedElement- Overrides:
addParseWarningin classParsedElement
-
getLocation
- Specified by:
getLocationin interfaceIParsedElement- Overrides:
getLocationin classParsedElement- Returns:
- The location of this parsed element within the source.
-
toString
Description copied from class:ExpressionSubclasses should return a String representing the parsed expression.- Specified by:
toStringin classExpression
-
getReturnType
- Specified by:
getReturnTypein interfaceIParsedElement- Overrides:
getReturnTypein classExpression
-
hasContent
public boolean hasContent()- Specified by:
hasContentin interfaceIProgram
-
getContainedParsedElementsByType
public <E extends IParsedElement> boolean getContainedParsedElementsByType(Class<E> parsedElementType, List<E> listResults) Description copied from class:ParsedElementFind all the parsed elements of a given type contained within this parsed element.- Specified by:
getContainedParsedElementsByTypein interfaceIParsedElement- Overrides:
getContainedParsedElementsByTypein classParsedElement- Parameters:
parsedElementType- The type of parsed element to find.listResults- A list of all the contained parsed elements matching the specified type. Can be null if you are only interested in whether or not parsedElementType exists in this element.- Returns:
- True iff one or more parseElementType are found.
-
findDeclaringStatement
public IParsedElementWithAtLeastOneDeclaration findDeclaringStatement(IParsedElement element, String identifierName) - Specified by:
findDeclaringStatementin interfaceIParsedElement- Overrides:
findDeclaringStatementin classParsedElement
-
getParseIssues
- Specified by:
getParseIssuesin interfaceIParsedElement- Overrides:
getParseIssuesin classParsedElement
-
getImmediateParseIssues
- Specified by:
getImmediateParseIssuesin interfaceIParsedElement- Overrides:
getImmediateParseIssuesin classParsedElement
-
hasParseExceptions
public boolean hasParseExceptions()- Specified by:
hasParseExceptionsin interfaceIParsedElement- Overrides:
hasParseExceptionsin classParsedElement
-
getParseExceptions
- Specified by:
getParseExceptionsin interfaceIParsedElement- Overrides:
getParseExceptionsin classParsedElement
-
getParseWarnings
- Specified by:
getParseWarningsin interfaceIParsedElement- Overrides:
getParseWarningsin classParsedElement
-
hasParseWarnings
public boolean hasParseWarnings()- Specified by:
hasParseWarningsin interfaceIParsedElement- Overrides:
hasParseWarningsin classParsedElement
-