Package com.scriptbasic.syntax
Class AbstractBasicProgramPostprocessing
java.lang.Object
com.scriptbasic.syntax.AbstractBasicProgramPostprocessing
- All Implemented Interfaces:
BuildableProgram,Program
- Direct Known Subclasses:
BasicProgram
public abstract class AbstractBasicProgramPostprocessing extends java.lang.Object implements BuildableProgram
- Author:
- Peter Verhas date Jul 18, 2012
-
Constructor Summary
Constructors Constructor Description AbstractBasicProgramPostprocessing() -
Method Summary
Modifier and Type Method Description protected abstract CommandgetFirstCommand()CommandgetStartCommand()protected abstract java.util.Map<java.lang.String,CommandSub>getSubroutineMap()voidpostprocess()Calling this method signals that all the commands are added to the program.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.scriptbasic.interfaces.Program
getCommands, getNamedCommand, getNamedCommandNames
-
Constructor Details
-
AbstractBasicProgramPostprocessing
public AbstractBasicProgramPostprocessing()
-
-
Method Details
-
getStartCommand
- Specified by:
getStartCommandin interfaceProgram
-
getSubroutineMap
-
getFirstCommand
-
postprocess
Description copied from interface:BuildableProgramCalling 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:
postprocessin interfaceBuildableProgram- Throws:
AnalysisException- when the postprocessing discovers syntax errors
-