public static void Rule(List lhs, OpenBracket openBracket, OptionalListBody optionalListBody, CloseBracket closeBracket) { if (optionalListBody.CodeList == null) { lhs.CodeList = new CodeList(); } else { lhs.CodeList = optionalListBody.CodeList; } }
protected virtual CloseBracket VisitCloseBracket(CloseBracket node) { return(VisitSyntaxNode(node) as CloseBracket); }
protected override CloseBracket VisitCloseBracket(CloseBracket node) { visitedCloseBracket = true; Assert.IsTrue(node.Value == "]"); return(base.VisitCloseBracket(node)); }
public static void Rule(List lhs, OpenBracket openBracket, OptionalListBody optionalListBody, CloseBracket closeBracket) { lhs.CodeList = optionalListBody.CodeList ?? new CodeList(); }
public static void Rule(List lhs, OpenBracket openBracket, OptionalListBody optionalListBody, CloseBracket closeBracket) { if (optionalListBody.CodeList == null) { lhs.CodeList = new CodeList(); } else { lhs.CodeList = optionalListBody.CodeList; } }
private bool ReadToken(out Token token) { var currentState = InputState.Start; var tokenStr = new StringBuilder(); for (; _pos < _expression.Length; _pos++) { var symbol = _expression[_pos]; var pair = _table.Get(new KeyValuePair <InputState, char>(currentState, symbol)); if (pair.Key == InputState.Start) { continue; } if (pair.Key == InputState.Finish) { switch (pair.Value) { case OutputState.Add: token = new Add(); Step(); return(true); case OutputState.Sub: token = new Substract(); Step(); return(true); case OutputState.Mul: token = new Multiply(); return(true); case OutputState.Div: token = new Divide(); Step(); return(true); case OutputState.Pow: token = new Power(); Step(); return(true); case OutputState.LBr: token = new OpenBracket(); Step(); return(true); case OutputState.RBr: token = new CloseBracket(); Step(); return(true); case OutputState.LPart: token = new Digit(tokenStr.ToString()); return(true); case OutputState.RPart: token = new Digit(tokenStr.ToString()); return(true); } } currentState = pair.Key; tokenStr.Append(symbol); } token = null; return(false); }
public static void Rule(List lhs, OpenBracket openBracket, OptionalListBody optionalListBody, CloseBracket closeBracket) { lhs.CodeList = optionalListBody.CodeList ?? new CodeList(); }