Class StatementList

    • Field Detail

      • _statements

        protected Statement[] _statements
      • _lastLine

        private int _lastLine
    • Constructor Detail

      • StatementList

        public StatementList​(IStackProvider stackProvider)
        Constructs a StatementList given an ISymbolTable instance.
    • Method Detail

      • setStatements

        public void setStatements​(java.util.List<Statement> statements)
        Parameters:
        statements - A list of Statements representing this statement-list.
      • indexOf

        public int indexOf​(Statement stmt)
      • tryToEliminateTheScope

        private void tryToEliminateTheScope()
        A statement-list needs to push a new scope on the symbol table to provide a for local variable scoping. Since this is a relatively expensive operation we avoid pushing the scope if we know none of the statements declare variables.
      • setNoScope

        public void setNoScope()
      • execute

        public java.lang.Object execute()
        Execute the list of statements.
        Specified by:
        execute in interface IStatement
        Overrides:
        execute in class Statement
      • getLeastSignificantTerminalStatementAfter

        public ITerminalStatement getLeastSignificantTerminalStatementAfter​(Statement fromStmt,
                                                                            boolean[] bAbsolute)
      • toString

        public java.lang.String toString()
        Description copied from class: Statement
        Subclasses should return a String representing the parsed statement.
        Specified by:
        toString in class Statement
      • getSelfOrSingleStatement

        public Statement getSelfOrSingleStatement()
      • setLastLineNumber

        public void setLastLineNumber​(int lastLine)