public virtual void PostWalk(BinaryExpr node) { }
public override void PostWalk(BinaryExpr node) { }
// BinaryExpr public virtual bool Walk(BinaryExpr node) { return true; }
// BinaryExpr public override bool Walk(BinaryExpr node) { return false; }
private Expr ParseMultiplicativeExpr() { Expr ret = ParsePrefixedExpr(); if (ret == null) return ret; TotemOperator op; while (IsMultiplicativeToken(PeekToken(), out op)) { Token t = NextToken(); var start = ret.StartIndex; ret = new BinaryExpr(op, ret, ParsePrefixedExpr()); ret.SetLoc(_globalParent, start, GetEnd()); } return ret; }
private Expr ParseRelationalExpr() { Expr ret = ParseAdditiveExpr(); if (ret == null) return ret; TotemOperator op; if (IsRelationalToken(PeekToken(), out op)) { Token t = NextToken(); var start = ret.StartIndex; ret = new BinaryExpr(op, ret, ParseRelationalExpr()); ret.SetLoc(_globalParent, start, GetEnd()); } return ret; }
private Expr ParseLogicalAndExpr() { Expr ret = ParseEqualityExpr(); if (ret == null) return ret; while (MaybeEat(TokenType.LogicalAnd)) { var start = ret.StartIndex; ret = new BinaryExpr(TotemOperator.LogicalAnd, ret, ParseEqualityExpr()); ret.SetLoc(_globalParent, start, GetEnd()); } return ret; }
// BinaryExpr public override bool Walk(BinaryExpr node) { node.Parent = _currentScope; return base.Walk(node); }