Package gw.lang.parser.exceptions
Class ParseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
gw.lang.parser.exceptions.ParseIssue
gw.lang.parser.exceptions.ParseException
- All Implemented Interfaces:
IParseIssue
,Serializable
- Direct Known Subclasses:
DoesNotOverrideFunctionException
,ImplicitCoercionError
,NoCtorFoundException
,NotImplementedParseException
,PropertyNotFoundException
,SymbolNotFoundException
,WrongNumberOfArgsException
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ParseException
private boolean
private IMemberAccessExpression
private IType[]
private IParameterInfo[][]
private IType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ParseException
(IParserState parserState, ResourceKey messageKey, Object... args) ParseException
(IParserState parserState, IType typeExpected, ResourceKey msgKey, Object... args) ParseException
(Integer lineNumber, Integer lineOffset, Integer tokenColumn, Integer tokenStart, Integer tokenEnd, ISymbolTable symbolTable, ResourceKey key, Object... msgArgs) private
ParseException
(Throwable t, IParserState state) -
Method Summary
Modifier and TypeMethodDescriptionAn alternate ParseException that may provide additional information.Override so we can reset the message if need be.IType[]
IParameterInfo[][]
boolean
void
setAlternateException
(ParseException alternateException) void
setCausedByArgumentList
(boolean bCausedByArgumentList) void
setExpectedType
(IType typeExpected) Sets the expected type information from the parser.void
void
setParamTypesExpected
(IType... paramTypesExpected) void
setParamTypesPossible
(IParameterInfo[][] paramTypesPossible) static ParseException
shallowCopy
(ParseException source) toString()
static ParseException
wrap
(Throwable t, IParserState state) Methods inherited from class gw.lang.parser.exceptions.ParseIssue
addLineOffset, adjustOffset, appliesToPosition, fillInStackTrace, formatError, getColumn, getContextString, getContextStringNoLineNumbers, getLine, getLineNumber, getLineOffset, getLineReportingOffset, getMessageArgs, getMessageKey, getPlainMessage, getSource, getStateSource, getSymbolTable, getTokenColumn, getTokenEnd, getTokenStart, getUIMessage, makeContextString, resetPositions, resolve, setMessage, setSource, setStateSource
Methods inherited from class java.lang.Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface gw.lang.parser.IParseIssue
printStackTrace
-
Field Details
-
_paramTypesExpected
-
_paramTypesPossible
-
_typeExpected
-
_memberAccessContext
-
_alternateException
-
_bCausedByArgumentList
private boolean _bCausedByArgumentList
-
-
Constructor Details
-
ParseException
- Parameters:
parserState
- The tokenizer in use by the parser (helpful for
-
ParseException
public ParseException(Integer lineNumber, Integer lineOffset, Integer tokenColumn, Integer tokenStart, Integer tokenEnd, ISymbolTable symbolTable, ResourceKey key, Object... msgArgs) -
ParseException
public ParseException(IParserState parserState, IType typeExpected, ResourceKey msgKey, Object... args) -
ParseException
-
ParseException
-
-
Method Details
-
wrap
-
shallowCopy
-
getConsoleMessage
Override so we can reset the message if need be.- Specified by:
getConsoleMessage
in interfaceIParseIssue
- Overrides:
getConsoleMessage
in classParseIssue
- Returns:
- the message for this parse issue formatted for printing out to a console
-
getExpectedType
- Specified by:
getExpectedType
in interfaceIParseIssue
- Overrides:
getExpectedType
in classParseIssue
- Returns:
- The parser's exprected types.
-
setExpectedType
Sets the expected type information from the parser. -
getParamTypesExpected
-
setParamTypesExpected
-
setParamTypesPossible
-
getParamTypesPossible
-
toString
-
getMemberAccessContext
- Returns:
- A member access context expression to further qualify the expected type. Typically the member access expression is an LHS operand in the containing. For example, the member access expression facilitates in TypeKey qualification -- we need the name of a field/property to get an appropriately filtered TypeList for a specific TypeKey on a specific field in an entity.
-
setMemberAccessContext
- Parameters:
ma
- A member access expression context to further qualify the expected type.
-
getAlternateException
An alternate ParseException that may provide additional information. For example, if the type of script is not know in advance (is it an expression or a program?), the script is first compiled as an expression. If a ParseException is thrown, the script is compiled as a program. If a ParseException is thrown again, the former exception is rethrown with the latter as the 'alternate'. -
setAlternateException
-
isCausedByArgumentList
public boolean isCausedByArgumentList() -
setCausedByArgumentList
public void setCausedByArgumentList(boolean bCausedByArgumentList)
-