Class ParserBase

    • Field Detail

      • _offsetShift

        protected int _offsetShift
      • _bDontOptimizeStatementLists

        protected boolean _bDontOptimizeStatementLists
    • Constructor Detail

      • ParserBase

        public ParserBase()
      • ParserBase

        public ParserBase​(GosuParser owner)
    • Method Detail

      • setOwner

        protected void setOwner​(GosuParser owner)
      • setIgnoreWarnings

        public void setIgnoreWarnings​(Set<ResourceKey> msgKeys)
      • pushExpression

        protected void pushExpression​(Expression e)
      • getScript

        protected abstract String getScript()
      • popExpression

        protected Expression popExpression()
      • peekExpression

        protected Expression peekExpression()
      • pushStatement

        protected void pushStatement​(Statement stmt)
      • popStatement

        protected Statement popStatement()
      • peekStatement

        protected Statement peekStatement()
      • eatBlock

        public final Token eatBlock​(char cBegin,
                                    char cEnd,
                                    boolean bOperator)
      • eatBlock

        public final Token eatBlock​(char cBegin,
                                    char cEnd,
                                    boolean bOperator,
                                    boolean bStopAtDeclarationKeyword)
      • eatTypeLiteral

        public void eatTypeLiteral()
      • parseDotPathWord

        public String parseDotPathWord​(String t)
        Parse a dot separated path as a single logical token
      • match

        protected final boolean match​(Token T,
                                      String token)
        Possibly matches the specified string token value. If a match occurs the token will be eaten and its information put into T (if T is not null).
        Parameters:
        T - the Token object to populate iff a match is found
        token - the string object to match
        Returns:
        true if a match occurred, and false otherwise
      • match

        protected final boolean match​(Token T,
                                      int iType)
        Possibly matches the specified token type. If a match occurs then the token will be eaten and its information put into T (if T is not null).
        Parameters:
        T - the Token object to populate iff a match is found
        iType - the token "type" to match (e.g. ISourceCodeTokenizer.TT_WORD)
        Returns:
        true if a match occurred, and false otherwise
      • match

        public final boolean match​(Token T,
                                   String token,
                                   int iType)
        Possibly matches the specified token or name (in token). If a match occurs then the token will be eaten and its information put into T (if T is not null).
        Parameters:
        T - the Token object to populate iff a match is found
        token - the string object to match
        iType - the token "type" to match (e.g. ISourceCodeTokenizer.TT_WORD)
        Returns:
        true if a match occurred, and false otherwise
      • match

        public final boolean match​(Token T,
                                   String token,
                                   int iType,
                                   boolean bPeek)
        Possibly matches the specified token or name (in token). If a match occurs and bPeek is false then the token will be eaten and its information put into T (if T is not null).
        Parameters:
        T - the Token object to populate iff a match is found
        token - the string object to match
        iType - the token "type" to match (e.g. ISourceCodeTokenizer.TT_WORD)
        bPeek - if true, a matching token will not be consumed (i.e. the stream will not advance to the next token.) if false, a matching token will be removed from the front of the stream.
        Returns:
        true if a match occurred, and false otherwise
      • match

        protected final boolean match​(Token T,
                                      Keyword token)
      • resolveType

        public static IType resolveType​(IType lhsType,
                                        int op,
                                        IType rhsType)
      • findMathOpMethod

        public static IMethodInfo findMathOpMethod​(IType lhsType,
                                                   int op,
                                                   IType rhsType)
      • isEvalClass

        protected boolean isEvalClass()
      • verifyComparable

        protected void verifyComparable​(IType lhsType,
                                        Expression rhs)
      • verifyComparable

        protected void verifyComparable​(IType lhsType,
                                        Expression rhs,
                                        boolean bBiDirectional,
                                        boolean bErrorIfCoercion)
      • verifyComparable

        protected void verifyComparable​(IType lhsType,
                                        Expression rhs,
                                        boolean bBiDirectional,
                                        boolean bErrorIfCoercion,
                                        IParserState state)
      • verifyTypesComparable

        protected IType verifyTypesComparable​(ParsedElement element,
                                              IType lhsType,
                                              IType rhsType,
                                              boolean bBiDirectional,
                                              boolean bErrorIfCoercion)
      • verifyNonVoidExpression

        public void verifyNonVoidExpression​(Expression eas)
      • eatOptionalSemiColon

        protected void eatOptionalSemiColon​(boolean bEat)
      • pushCurrentBlock

        public void pushCurrentBlock​(BlockExpression block)
      • addBlockToBlockStack

        public void addBlockToBlockStack​(BlockExpression block)
      • isParsingBlock

        public boolean isParsingBlock()
      • copyBlockStackTo

        protected void copyBlockStackTo​(ParserBase otherParser)
      • possiblyWrapWithImplicitCoercion

        protected Expression possiblyWrapWithImplicitCoercion​(Expression expressionToCoerce,
                                                              IType typeToCoerceTo)
      • possiblyWrapWithCoercion

        protected Expression possiblyWrapWithCoercion​(Expression expressionToCoerce,
                                                      IType typeToCoerceTo,
                                                      boolean bImplicit)
      • setLocationForImplicitTypeAs

        protected void setLocationForImplicitTypeAs​(Expression expressionToCoerce,
                                                    TypeAsExpression tas)
      • setOffsetShift

        protected void setOffsetShift​(int offsetShift)
      • pushInferringFunctionTypeVars

        protected void pushInferringFunctionTypeVars​(List<IType> typeVariableTypes)
      • popInferringFunctionTypeVariableTypes

        protected List<IType> popInferringFunctionTypeVariableTypes()
      • peekInferringFunctionTypeVariableTypes

        protected List<IType> peekInferringFunctionTypeVariableTypes()
      • getCurrentlyInferringFunctionTypeVars

        public List<IType> getCurrentlyInferringFunctionTypeVars()
      • matchDeclarationKeyword

        public static boolean matchDeclarationKeyword​(String[] ret,
                                                      boolean bPeek,
                                                      SourceCodeTokenizer tokenizer)
      • shouldSnapshotSymbols

        public boolean shouldSnapshotSymbols()
      • setSnapshotSymbols

        public void setSnapshotSymbols()