Example #1
0
 // {{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;
 }
Example #2
0
 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;
 }
Example #3
0
 internal static void AddList( ListNode list, Node next, Symbol s )
 {
     list.nodes.Add(next);
     list.end = s.endpos;
 }
Example #4
0
 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();
 }
Example #5
0
 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();
 }
Example #6
0
 internal static bool ContainsDimSpec( Node expr )
 {
     return expr.kind == Kind.DimmedExpr;
 }
Example #7
0
 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;
 }