def visitExprSwitch(self, exprSwitch): #print('visitExprSwitch') st.beginScope(st.SWITCH) tipo = exprSwitch.switchStmt_Head.accept(self) st.symbolTable[-1][st.SWITCHTYPE] = tipo exprSwitch.switchStmt_Body.accept(self) st.varCheck(st.endScope())
def visitCompIfElse(self, compIfElse): #print('visitCompIfElse') st.beginScope(st.IF) compIfElse.Expression.accept(self) compIfElse.Block.accept(self) st.varCheck(st.endScope()) compIfElse.IfStmt.accept(self)
def visitIfElse(self, ifElse): #print('visitIfElse') st.beginScope(st.IF) ifElse.Expression.accept(self) ifElse.Block.accept(self) st.varCheck(st.endScope()) st.beginScope(st.ELSE) ifElse.Block1.accept(self) st.varCheck(st.endScope())
def visitStmtForBlock(self, stmtForBlock): #print('visitStmtForBlock') st.beginScope(st.FOR) stmtForBlock.Block.accept(self) st.varCheck(st.endScope())
def visitStmtForRange(self, stmtForRange): #print('visitStmtForRange') st.beginScope(st.FOR) stmtForRange.RangeClause.accept(self) stmtForRange.Block.accept(self) st.varCheck(st.endScope())
def visitStmtFor(self, stmtFor): #print('visitStmtFor') st.beginScope(st.FOR) stmtFor.Condition.accept(self) stmtFor.Block.accept(self) st.varCheck(st.endScope())
def visitExprSwitchSimple(self, exprSwitchSimple): #print('visitExprSwitchSimple') st.beginScope(st.SWITCH) st.symbolTable[-1][st.SWITCHTYPE] = '' exprSwitchSimple.switchStmt_Body.accept(self) st.varCheck(st.endScope())
def visitSimpleIf(self, simpleIf): #print('visitSimpleIf') st.beginScope(st.IF) simpleIf.Expression.accept(self) simpleIf.Block.accept(self) st.varCheck(st.endScope())
def visitMultFunc(self, multFunc): multFunc.StatementList.accept(self) st.varCheck(st.endScope()) multFunc.FunctionDecl.accept(self)