Class Parser


  • public class Parser
    extends java_cup.runtime.lr_parser
    CUP v0.11b 20160615 (GIT 4ac7450) generated parser.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static short[][] _action_table
      Parse-action table.
      protected static short[][] _production_table
      Production table.
      protected static short[][] _reduce_table
      reduce_goto table.
      protected adams.parser.actorsuggestion.Parser.CUP$Parser$actions action_obj
      Instance of action encapsulation class.
      protected Node[] m_ActorNodes
      all the current nodes in which to insert/add to the proposed actor.
      protected Actor[] m_Actors
      all the current actors in which to insert/add to the proposed actor.
      protected Compatibility m_Compatibility
      for checking compatibility.
      protected ParserHelper m_Helper
      the helper.
      protected Actor m_LastParent
      the last parent used.
      protected Node m_LastParentNode
      the last parent node used.
      protected Actor m_Parent
      the parent of the proposed actor.
      protected Node m_ParentNode
      the parent node of the proposed actor.
      protected Integer m_Position
      the position to add the proposed actor at.
      protected Actor m_Result
      for storing the result of the expression.
      • Fields inherited from class java_cup.runtime.lr_parser

        _done_parsing, _error_sync_size, action_tab, cur_token, lookahead, lookahead_pos, production_tab, reduce_tab, stack, symbolFactory, tos
    • Constructor Summary

      Constructors 
      Constructor Description
      Parser()
      Deprecated.
      Parser​(java_cup.runtime.Scanner s)
      Deprecated.
      Parser​(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf)
      Constructor which sets the default scanner.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      short[][] action_table()
      Access to parse-action table.
      Boolean checkParent​(String classname, boolean exact, boolean anyParent)
      Checks whether the parent is the specified classname.
      java_cup.runtime.Symbol do_action​(int act_num, java_cup.runtime.lr_parser parser, Stack stack, int top)
      Invoke a user supplied parse action.
      int EOF_sym()
      EOF Symbol index.
      int error_sym()
      error Symbol index.
      Boolean followingAccepts​(String classname)
      Checks whether the following actor accepts the specified class.
      Node[] getActorNodes()
      Returns the nodes in which to insert the proposed actor.
      Actor[] getActors()
      Returns the actors in which to insert the proposed actor.
      ParserHelper getHelper()
      Returns the parser helper.
      Actor getParent()
      Returns the parent of the proposed actor.
      Node getParentNode()
      Returns the parent node of the proposed actor.
      Integer getPosition()
      Returns the position of the proposed actor.
      Actor getResult()
      Returns the result of the evaluation.
      Class getSymbolContainer()  
      protected void init_actions()
      Action encapsulation object initializer.
      String insertPlaceholders​(String cmdline)
      Processes the commandline and fills in placeholders: classname: ${PARENT.CLASS}, ${LASTPARENT.CLASS}, ${PRECEDING.CLASS}, ${FOLLOWING.CLASS} actor's name: ${PARENT.NAME}, ${LASTPARENT.NAME}, ${PRECEDING.NAME}, ${FOLLOWING.NAME} actor's full name: ${PARENT.FULL}, ${LASTPARENT.FULL}, ${PRECEDING.FULL}, ${FOLLOWING.FULL}
      Boolean isClassname​(boolean before, String classname)
      Checks whether the actor will get added before or after a specific actor (exact classname or interface classname).
      Boolean isFirst()
      Returns whether the proposed actor will get added at the first position.
      Boolean isLast()
      Returns whether the proposed actor will get added at the last position.
      Boolean isSink​(boolean before)
      Checks whether the actor will get added before or after a sink actor.
      Boolean isSource​(boolean before)
      Checks whether the actor will get added before or after a source actor.
      Boolean isStandalone​(boolean before)
      Checks whether the actor will get added before or after a standalone actor.
      Boolean isTransformer​(boolean before)
      Checks whether the actor will get added before or after a transformer actor.
      Boolean precedingGenerates​(String classname)
      Checks whether the preceding actor generates the specified class.
      short[][] production_table()
      Access to production table.
      short[][] reduce_table()
      Access to reduce_goto table.
      void setActorNodes​(Node[] value)
      Sets the nodes in which to insert the proposed actor.
      void setActors​(Actor[] value)
      Sets the actors in which to insert the proposed actor.
      void setParent​(Actor value)
      Sets the parent of the proposed actor.
      void setParentNode​(Node value)
      Sets the parent node of the proposed actor.
      void setPosition​(Integer value)
      Sets the position of the proposed actor.
      void setResult​(Actor value)
      Sets the result of the evaluation.
      int start_production()
      Indicates start production.
      int start_state()
      Indicates start state.
      • Methods inherited from class java_cup.runtime.lr_parser

        advance_lookahead, cur_err_token, debug_message, debug_parse, debug_reduce, debug_shift, debug_stack, done_parsing, dump_stack, error_recovery, error_sync_size, expected_token_ids, find_recovery_config, get_action, get_reduce, getScanner, getSymbolFactory, parse, parse_lookahead, read_lookahead, report_error, report_expected_token_ids, report_fatal_error, restart_lookahead, scan, setScanner, shift_under_error, symbl_name_from_id, syntax_error, try_parse_ahead, unpackFromStrings, unrecovered_syntax_error, user_init
    • Field Detail

      • _production_table

        protected static final short[][] _production_table
        Production table.
      • _action_table

        protected static final short[][] _action_table
        Parse-action table.
      • _reduce_table

        protected static final short[][] _reduce_table
        reduce_goto table.
      • action_obj

        protected adams.parser.actorsuggestion.Parser.CUP$Parser$actions action_obj
        Instance of action encapsulation class.
      • m_Result

        protected Actor m_Result
        for storing the result of the expression.
      • m_Parent

        protected Actor m_Parent
        the parent of the proposed actor.
      • m_ParentNode

        protected Node m_ParentNode
        the parent node of the proposed actor.
      • m_LastParent

        protected Actor m_LastParent
        the last parent used.
      • m_LastParentNode

        protected Node m_LastParentNode
        the last parent node used.
      • m_Position

        protected Integer m_Position
        the position to add the proposed actor at.
      • m_Actors

        protected Actor[] m_Actors
        all the current actors in which to insert/add to the proposed actor.
      • m_ActorNodes

        protected Node[] m_ActorNodes
        all the current nodes in which to insert/add to the proposed actor.
      • m_Compatibility

        protected Compatibility m_Compatibility
        for checking compatibility.
    • Constructor Detail

      • Parser

        @Deprecated
        public Parser()
        Deprecated.
        Default constructor.
      • Parser

        @Deprecated
        public Parser​(java_cup.runtime.Scanner s)
        Deprecated.
        Constructor which sets the default scanner.
      • Parser

        public Parser​(java_cup.runtime.Scanner s,
                      java_cup.runtime.SymbolFactory sf)
        Constructor which sets the default scanner.
    • Method Detail

      • getSymbolContainer

        public final Class getSymbolContainer()
        Overrides:
        getSymbolContainer in class java_cup.runtime.lr_parser
      • production_table

        public short[][] production_table()
        Access to production table.
        Specified by:
        production_table in class java_cup.runtime.lr_parser
      • action_table

        public short[][] action_table()
        Access to parse-action table.
        Specified by:
        action_table in class java_cup.runtime.lr_parser
      • reduce_table

        public short[][] reduce_table()
        Access to reduce_goto table.
        Specified by:
        reduce_table in class java_cup.runtime.lr_parser
      • init_actions

        protected void init_actions()
        Action encapsulation object initializer.
        Specified by:
        init_actions in class java_cup.runtime.lr_parser
      • do_action

        public java_cup.runtime.Symbol do_action​(int act_num,
                                                 java_cup.runtime.lr_parser parser,
                                                 Stack stack,
                                                 int top)
                                          throws Exception
        Invoke a user supplied parse action.
        Specified by:
        do_action in class java_cup.runtime.lr_parser
        Throws:
        Exception
      • start_state

        public int start_state()
        Indicates start state.
        Specified by:
        start_state in class java_cup.runtime.lr_parser
      • start_production

        public int start_production()
        Indicates start production.
        Specified by:
        start_production in class java_cup.runtime.lr_parser
      • EOF_sym

        public int EOF_sym()
        EOF Symbol index.
        Specified by:
        EOF_sym in class java_cup.runtime.lr_parser
      • error_sym

        public int error_sym()
        error Symbol index.
        Specified by:
        error_sym in class java_cup.runtime.lr_parser
      • getHelper

        public ParserHelper getHelper()
        Returns the parser helper.
        Returns:
        the helper
      • setResult

        public void setResult​(Actor value)
        Sets the result of the evaluation.
        Parameters:
        value - the result
      • getResult

        public Actor getResult()
        Returns the result of the evaluation.
        Returns:
        the result
      • setParent

        public void setParent​(Actor value)
        Sets the parent of the proposed actor.
        Parameters:
        value - the actor
      • getParent

        public Actor getParent()
        Returns the parent of the proposed actor.
        Returns:
        the parent
      • setParentNode

        public void setParentNode​(Node value)
        Sets the parent node of the proposed actor.
        Parameters:
        value - the actor
      • getParentNode

        public Node getParentNode()
        Returns the parent node of the proposed actor.
        Returns:
        the parent
      • setPosition

        public void setPosition​(Integer value)
        Sets the position of the proposed actor.
        Parameters:
        value - the position
      • getPosition

        public Integer getPosition()
        Returns the position of the proposed actor.
        Returns:
        the position
      • setActors

        public void setActors​(Actor[] value)
        Sets the actors in which to insert the proposed actor.
        Parameters:
        value - the actors
      • getActors

        public Actor[] getActors()
        Returns the actors in which to insert the proposed actor.
        Returns:
        the actors
      • setActorNodes

        public void setActorNodes​(Node[] value)
        Sets the nodes in which to insert the proposed actor.
        Parameters:
        value - the nodes
      • getActorNodes

        public Node[] getActorNodes()
        Returns the nodes in which to insert the proposed actor.
        Returns:
        the nodes
      • isFirst

        public Boolean isFirst()
        Returns whether the proposed actor will get added at the first position.
        Returns:
        true if the actor gets added at the first position
      • isLast

        public Boolean isLast()
        Returns whether the proposed actor will get added at the last position.
        Returns:
        true if the actor gets added at the last position
      • isStandalone

        public Boolean isStandalone​(boolean before)
        Checks whether the actor will get added before or after a standalone actor.
        Parameters:
        before - whether the actor gets added before or after
        Returns:
        true if the actor gets added before/after a standalone one
      • isSource

        public Boolean isSource​(boolean before)
        Checks whether the actor will get added before or after a source actor.
        Parameters:
        before - whether the actor gets added before or after
        Returns:
        true if the actor gets added before/after a source one
      • isTransformer

        public Boolean isTransformer​(boolean before)
        Checks whether the actor will get added before or after a transformer actor.
        Parameters:
        before - whether the actor gets added before or after
        Returns:
        true if the actor gets added before/after a transformer one
      • isSink

        public Boolean isSink​(boolean before)
        Checks whether the actor will get added before or after a sink actor.
        Parameters:
        before - whether the actor gets added before or after
        Returns:
        true if the actor gets added before/after a sink one
      • isClassname

        public Boolean isClassname​(boolean before,
                                   String classname)
        Checks whether the actor will get added before or after a specific actor (exact classname or interface classname).
        Parameters:
        before - whether the actor gets added before or after
        classname - the name of the actor (or interface) to check against
        Returns:
        true if the actor gets added before/after a specific one
      • checkParent

        public Boolean checkParent​(String classname,
                                   boolean exact,
                                   boolean anyParent)
        Checks whether the parent is the specified classname.
        Parameters:
        classname - the class that parent must be
        exact - whether to perform exact classname matching (or just an instance of)
        anyParent - if any parent in the node hierarchy is tested
        Returns:
        true if it is a match
      • precedingGenerates

        public Boolean precedingGenerates​(String classname)
        Checks whether the preceding actor generates the specified class.
        Parameters:
        classname - the class that the preceding actor must generate
        Returns:
        true if the preceding actor generates the specified class
      • followingAccepts

        public Boolean followingAccepts​(String classname)
        Checks whether the following actor accepts the specified class.
        Parameters:
        classname - the class that the following actor must accept
        Returns:
        true if the following actor accepts the specified class
      • insertPlaceholders

        public String insertPlaceholders​(String cmdline)
        Processes the commandline and fills in placeholders: classname: ${PARENT.CLASS}, ${LASTPARENT.CLASS}, ${PRECEDING.CLASS}, ${FOLLOWING.CLASS} actor's name: ${PARENT.NAME}, ${LASTPARENT.NAME}, ${PRECEDING.NAME}, ${FOLLOWING.NAME} actor's full name: ${PARENT.FULL}, ${LASTPARENT.FULL}, ${PRECEDING.FULL}, ${FOLLOWING.FULL}
        Parameters:
        cmdline - the commandline to process
        Returns:
        the fullname of the specified actor or empty string if not available
        See Also:
        m_LastParent, m_LastParentNode