public void Visit(LogicalExpr node) { VisitChildren (node); ApplyOperatorToOperands (node); }
private Expression ExprLogical() { if ((Token.Types)currentToken.Type == Token.Types.And) { LogicalExpr logicalExpr = new LogicalExpr ("&", currentToken.Row, currentToken.Column); Match (Token.Types.And); logicalExpr.AddChild (Conjuct ()); Expression expression = ExprLogical (); if (expression.Name != null) { logicalExpr.AddChild (expression); } return logicalExpr; } else if ((Token.Types)currentToken.Type == Token.Types.RightParenthesis || (Token.Types)currentToken.Type == Token.Types.Range || (Token.Types)currentToken.Type == Token.Types.Do || (Token.Types)currentToken.Type == Token.Types.Semicolon) { return new LogicalExpr(null, currentToken.Row, currentToken.Column); } throw new SyntaxError ("invalid token to start expression " + currentToken.Type, currentToken.Row, currentToken.Column); }