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
All Methods Instance Methods Abstract Methods Concrete Methods 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, wait
-
Methods inherited from interface com.scriptbasic.interfaces.BuildableProgram
addCommand, reset
-
Methods inherited from interface com.scriptbasic.interfaces.Program
getCommands, getNamedCommand, getNamedCommandNames
-
-
-
-
Method Detail
-
getStartCommand
public Command getStartCommand()
- Specified by:
getStartCommandin interfaceProgram
-
getSubroutineMap
protected abstract java.util.Map<java.lang.String,CommandSub> getSubroutineMap()
-
getFirstCommand
protected abstract Command getFirstCommand()
-
postprocess
public void postprocess() throws AnalysisExceptionDescription 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
-
-