public ParserType Visit(ParserStringConstant constant) { switch (constant.Value) { case "T": case "F": ParserType logicType = new ParserLogicType(); constant.Type = logicType; return(logicType); default: throw new ArgumentException("Unknown Constant: " + constant.Value); } }
public Expression Visit(ParserStringConstant constant) { switch (constant.Value) { case "T": return(new LogicTrue()); case "F": return(new LogicFalse()); default: break; } throw new ArgumentException("Unknown constant"); }