public void process(WhileStatment whileStatment) { BoolStatment boolSatment = (BoolStatment)whileStatment.getTokensList()[0]; _leftExpression = IfStatmentProcessor.getLeftExpression((BoolExpression)boolSatment.getTokensList()[0]); if (_leftExpression[0].kind == Constants.IDENTIFIER) { SemanticAnalizer.checkVarible(_leftExpression[0].value); } if (_leftExpression[2].kind == Constants.IDENTIFIER) { SemanticAnalizer.checkVarible(_leftExpression[2].value); } _rightExpression = IfStatmentProcessor.getElseAndThenStatments((StatmentPart)whileStatment.getTokensList()[1]); generate(); }
public void process(IfStatment ifStatment) { isElseAppear = false; BoolStatment boolStatment = (BoolStatment)ifStatment.getTokensList()[0]; _leftExpression = getLeftExpression((BoolExpression)boolStatment.getTokensList()[0]); if (_leftExpression[0].kind == Constants.IDENTIFIER) { SemanticAnalizer.checkVarible(_leftExpression[0].value); } if (_leftExpression[2].kind == Constants.IDENTIFIER) { SemanticAnalizer.checkVarible(_leftExpression[2].value); } _thenExpression = getElseAndThenStatments((StatmentPart)ifStatment.getTokensList()[1]); if (ifStatment.getTokensList().Count == 3) { isElseAppear = true; _elseExpression = getElseAndThenStatments((StatmentPart)ifStatment.getTokensList()[2]); } generate(); }
static public string visit(BoolStatment boolStatment) { return(Constants.BOOL_STATMENT); }