package semanticActions; import java.lang.*; import errors.*; import java.util.*; import lex.*; import parser.*; import symbolTable.*; import drivers.*; public class SemanticActions { private Stack semanticStack ; private Quadruples quads ; private boolean insert ; private boolean isArray ; private boolean global ; private int globalMemory ; private int localMemory ; public SemanticActions() { semanticStack = new Stack(); quads = new Quadruples(); insert = false; isArray = false; isParm = false; global = true; globalMemory = 0 ; localMemory = 0; globalTable = new SymbolTable(tableSize); constantTable = new SymbolTable(tablesize); InstallBuiltins(globalTable); } public void Execute (SemanticAction action, Token token) throws SemanticError { int actionNumber = action.getIndex(); System.out.println("calling action : " + actionNumber + " with token " + token.getType()); switch (actionNumber) { case 1 : { insert = true; break; } case 2 : { insert = false; break; } case 3 : { break; } case 4 : { semanticStack.push(token); break; } case 6 : { isArray = true; break; } case 7 : { semanticStack.push(token); break; } case 13 : { semanticStack.push(token); break; } }