Class AbstractBasicProgramPostprocessing

java.lang.Object
com.scriptbasic.syntax.AbstractBasicProgramPostprocessing
All Implemented Interfaces:
BuildableProgram, Program
Direct Known Subclasses:
BasicProgram

public abstract class AbstractBasicProgramPostprocessing extends Object implements BuildableProgram
Author:
Peter Verhas date Jul 18, 2012
  • Constructor Details

    • AbstractBasicProgramPostprocessing

      public AbstractBasicProgramPostprocessing()
  • Method Details

    • getStartCommand

      public Command getStartCommand()
      Specified by:
      getStartCommand in interface Program
    • getSubroutineMap

      protected abstract Map<String,CommandSub> getSubroutineMap()
    • getFirstCommand

      protected abstract Command getFirstCommand()
    • postprocess

      public void postprocess() throws AnalysisException
      Description copied from interface: BuildableProgram
      Calling this method signals that all the commands are added to the program. This method has to perform all the polishing of the built program that are to be done after the commands are analyzed. These include:
      • optimizing expressions
      • recalculating if/elseif/else/endif jumps
      • building subroutine symbol table
      • checking syntax analysis rules that apply to the whole program and are easier to implement this way than keeping different state informations during the syntax analysis, which is line oriented. For example checking that all LOCAL and GLOBAL declarations in a SUB are before any executable statement, subs are not nested...
      Specified by:
      postprocess in interface BuildableProgram
      Throws:
      AnalysisException - when the postprocessing discovers syntax errors