Class GeneratedJavaParserBase

    • Field Detail

      • problems

        java.util.List<Problem> problems
      • storeTokens

        boolean storeTokens
    • Constructor Detail

      • GeneratedJavaParserBase

        GeneratedJavaParserBase()
    • Method Detail

      • ReInit

        abstract void ReInit​(Provider provider)
      • getNextToken

        abstract Token getNextToken()
      • reset

        void reset​(Provider provider)
      • getTokens

        public java.util.List<JavaToken> getTokens()
        Return the list of JavaParser specific tokens that have been encountered while parsing code using this parser.
        Returns:
        a list of tokens
      • addProblem

        void addProblem​(java.lang.String message)
      • range

        TokenRange range​(Node begin,
                         Node end)
        Return a TokenRange spanning from begin to end
      • orIfInvalid

        JavaToken orIfInvalid​(JavaToken firstChoice,
                              JavaToken secondChoice)
        Returns:
        secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice
      • orIfInvalid

        JavaToken orIfInvalid​(JavaToken firstChoice,
                              Node secondChoice)
        Returns:
        the begin-token secondChoice if firstChoice is JavaToken.UNKNOWN, otherwise firstChoice
      • nodeListBegin

        JavaToken nodeListBegin​(NodeList<?> l)
        Get the token that starts the NodeList l
      • setTokenKind

        void setTokenKind​(int newKind)
      • setStoreTokens

        void setStoreTokens​(boolean storeTokens)
      • emptyList

        <T extends NodeNodeList<T> emptyList()
        Quickly create a new NodeList
      • add

        <T extends NodeNodeList<T> add​(NodeList<T> list,
                                         T obj)
        Add obj to list and return it. Create a new list if list is null
      • addWhenNotNull

        <T extends NodeNodeList<T> addWhenNotNull​(NodeList<T> list,
                                                    T obj)
        Add obj to list only when list is not null
      • prepend

        <T extends NodeNodeList<T> prepend​(NodeList<T> list,
                                             T obj)
        Add obj to list at position pos
      • add

        <T> java.util.List<T> add​(java.util.List<T> list,
                                  T obj)
        Add obj to list
      • propagateRangeGrowthOnRight

        private void propagateRangeGrowthOnRight​(Node node,
                                                 Node endNode)
        Propagate expansion of the range on the right to the parent. This is necessary when the right border of the child is determining the right border of the parent (i.e., the child is the last element of the parent). In this case when we "enlarge" the child we should enlarge also the parent.
      • generateLambda

        Expression generateLambda​(Expression ret,
                                  Statement lambdaBody)
        Workaround for rather complex ambiguity that lambda's create
      • juggleArrayType

        Type juggleArrayType​(Type partialType,
                             java.util.List<ArrayType.ArrayBracketPair> additionalBrackets)
        Throws together a Type, taking care of all the array brackets
      • makeMessageForParseException

        private java.lang.String makeMessageForParseException​(ParseException exception)
        This is the code from ParseException.initialise, modified to be more horizontal.
      • scopeToName

        Name scopeToName​(Expression scope)
        Converts a NameExpr or a FieldAccessExpr scope to a Name.
      • unquote

        java.lang.String unquote​(java.lang.String s)
      • unTripleQuote

        java.lang.String unTripleQuote​(java.lang.String s)
      • setYieldSupported

        void setYieldSupported()