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
public class Program extends Expression implements IProgram
An expression representing a Program:- See Also:
IGosuParser
-
-
Field Summary
-
Fields inherited from class gw.internal.gosu.parser.Expression
_type
-
Fields inherited from class gw.internal.gosu.parser.ParsedElement
_tokens, UNDEF_FILE, UNDEF_FUNCTION, UNDEF_MODULE
-
Fields inherited from interface gw.lang.parser.IExpression
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description Program()Constructs a Program given an ISymbolTable instance.
-
Method Summary
-
Methods inherited from class gw.internal.gosu.parser.Expression
evaluate, getContextType, getType, getTypeImpl, isNullSafe, isUnchecked, setType
-
Methods 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, visit
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface gw.lang.parser.IExpression
evaluate, getContextType, isNullSafe, isUnchecked
-
Methods 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
-
-
-
-
Method Detail
-
getMainStatement
public Statement getMainStatement()
- Specified by:
getMainStatementin interfaceIProgram
-
setMainStatement
public void setMainStatement(Statement mainStatement)
-
getFunctions
public Map getFunctions()
- Specified by:
getFunctionsin interfaceIProgram
-
setFunctions
public void setFunctions(Map functions)
-
getDeclaredReturnType
public IType getDeclaredReturnType()
-
setDeclaredReturnType
public void setDeclaredReturnType(IType declaredReturnType)
-
evaluate
public Object evaluate()
- Specified by:
evaluatein interfaceIExpression- Overrides:
evaluatein classExpression
-
addParseWarning
public void addParseWarning(IParseIssue warning)
- Specified by:
addParseWarningin interfaceIParsedElement- Overrides:
addParseWarningin classParsedElement
-
getLocation
public ParseTree getLocation()
- Specified by:
getLocationin interfaceIParsedElement- Overrides:
getLocationin classParsedElement- Returns:
- The location of this parsed element within the source.
-
toString
public String toString()
Description copied from class:ExpressionSubclasses should return a String representing the parsed expression.- Specified by:
toStringin classExpression
-
getReturnType
public IType 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
public List<IParseIssue> getParseIssues()
- Specified by:
getParseIssuesin interfaceIParsedElement- Overrides:
getParseIssuesin classParsedElement
-
getImmediateParseIssues
public List<IParseIssue> getImmediateParseIssues()
- Specified by:
getImmediateParseIssuesin interfaceIParsedElement- Overrides:
getImmediateParseIssuesin classParsedElement
-
hasParseExceptions
public boolean hasParseExceptions()
- Specified by:
hasParseExceptionsin interfaceIParsedElement- Overrides:
hasParseExceptionsin classParsedElement
-
getParseExceptions
public List<IParseIssue> getParseExceptions()
- Specified by:
getParseExceptionsin interfaceIParsedElement- Overrides:
getParseExceptionsin classParsedElement
-
getParseWarnings
public List<IParseIssue> getParseWarnings()
- Specified by:
getParseWarningsin interfaceIParsedElement- Overrides:
getParseWarningsin classParsedElement
-
hasParseWarnings
public boolean hasParseWarnings()
- Specified by:
hasParseWarningsin interfaceIParsedElement- Overrides:
hasParseWarningsin classParsedElement
-
-