public AstPrinterNode Visit(IndexRangeNode node) { var printer = new AstPrinterNode(node.ToString()); printer.AddChild(node.LeftBound.Accept(this)); printer.AddChild(node.RightBound.Accept(this)); return(printer); }
public bool Visit(IndexRangeNode node) { node.LeftBound.Accept(this); if (!node.LeftBound.SymType.Equals(SymbolStack.SymInt)) { throw new Exception(string.Format( "({0}, {1}) semantic error: index bound '{2}' is not integer", node.LeftBound.Token.Line, node.LeftBound.Token.Line, node.LeftBound.ToString())); } node.RightBound.Accept(this); if (!node.RightBound.SymType.Equals(SymbolStack.SymInt)) { throw new Exception(string.Format( "({0}, {1}) semantic error: index bound '{2}' is not integer", node.RightBound.Token.Line, node.RightBound.Token.Line, node.RightBound.ToString())); } return(true); }