// {{Methods}} internal static ListNode List( Node first, Symbol s ) { ListNode res = new ListNode(); res.kind = Kind.List; res.start = s.pos; res.end = s.endpos; res.nodes = new ArrayList(); res.nodes.Add(first); return res; }
internal static NewArrayNode NewArray( TypeNode type, ListNode exprlist, ListNode ranks, Node arrayinit, Symbol s ) { NewArrayNode res = new NewArrayNode(); res.kind = Kind.NewArray; res.start = s.pos; res.end = s.endpos; res.type = type; res.exprlist = exprlist; res.ranks = ranks; res.arrayinit = arrayinit; return res; }
internal static void AddList( ListNode list, Node next, Symbol s ) { list.nodes.Add(next); list.end = s.endpos; }
public static void ShowNode( Node n, string text ) { Form f = new Form(); f.Text = "Node Debug"; f.Width = 800; f.Height = 450; NodeView nv = new NodeView( n, text ); nv.Dock = DockStyle.Fill; f.Controls.Add( nv ); f.ShowDialog(); }
private NodeView( Node n, string text ) { this.n = n; this.text = text; TreeNode tn = this.Nodes.Add( n.GetType().Name + " " + n.ToString() ); tn.Tag = new NodeTag( n ); init_children( tn ); tn.Expand(); }
internal static bool ContainsDimSpec( Node expr ) { return expr.kind == Kind.DimmedExpr; }
internal static bool CanBeType( Node expr ) { switch( expr.kind ) { case Kind.Identifier: case Kind.TypeDot: return true; case Kind.Dot: return CanBeType( ((BinaryNode)expr).left ); case Kind.DimmedExpr: return CanBeType( ((TypeExprNode)expr).expr ); } return false; }