Added Antlr.Runtime/antlr.collections and Antlr.Runtime/antlr.collections/AST.cs.
authorCésar Natarén <cesar@mono-cvs.ximian.com>
Tue, 22 Apr 2003 04:59:15 +0000 (04:59 -0000)
committerCésar Natarén <cesar@mono-cvs.ximian.com>
Tue, 22 Apr 2003 04:59:15 +0000 (04:59 -0000)
svn path=/trunk/mcs/; revision=13874

mcs/class/Microsoft.JScript/Antlr.Runtime/antlr.collections/AST.cs [new file with mode: 0755]

diff --git a/mcs/class/Microsoft.JScript/Antlr.Runtime/antlr.collections/AST.cs b/mcs/class/Microsoft.JScript/Antlr.Runtime/antlr.collections/AST.cs
new file mode 100755 (executable)
index 0000000..2bbfb4e
--- /dev/null
@@ -0,0 +1,66 @@
+using System;\r
+using IEnumerator = System.Collections.IEnumerator;\r
+\r
+using Token = antlr.Token;\r
+       \r
+namespace antlr.collections\r
+{\r
+       /*ANTLR Translator Generator\r
+       * Project led by Terence Parr at http://www.jGuru.com\r
+       * Software rights: http://www.antlr.org/RIGHTS.html\r
+       *\r
+       * $Id: AST.cs,v 1.1 2003/04/22 04:59:15 cesar Exp $\r
+       */\r
+\r
+       //\r
+       // ANTLR C# Code Generator by Micheal Jordan\r
+       //                            Kunle Odutola       : kunle UNDERSCORE odutola AT hotmail DOT com\r
+       //                            Anthony Oguntimehin\r
+       //\r
+       // With many thanks to Eric V. Smith from the ANTLR list.\r
+       //\r
+\r
+       /*Minimal AST node interface used by ANTLR AST generation\r
+       * and tree-walker.\r
+       */\r
+       public interface AST : ICloneable\r
+       {\r
+               /*Add a (rightmost) child to this node */\r
+               void  addChild(AST c);\r
+               bool Equals(AST t);\r
+               bool EqualsList(AST t);\r
+               bool EqualsListPartial(AST t);\r
+               bool EqualsTree(AST t);\r
+               bool EqualsTreePartial(AST t);\r
+               IEnumerator findAll(AST tree);\r
+               IEnumerator findAllPartial(AST subtree);\r
+               /*Get the first child of this node; null if no children */\r
+               AST getFirstChild();\r
+               /*Get   the next sibling in line after this one */\r
+               AST getNextSibling();\r
+               /*Get the token text for this node */\r
+               string getText();\r
+               /*Get the token type for this node */\r
+               int Type        { get; set;}\r
+               /// <summary>\r
+               /// Get number of children of this node; if leaf, returns 0\r
+               /// </summary>\r
+               /// <returns>Number of children</returns>\r
+               int getNumberOfChildren();\r
+               void  initialize(int t, string txt);\r
+               void  initialize(AST t);\r
+               void  initialize(Token t);\r
+               /*Set the first child of a node. */\r
+               void  setFirstChild(AST c);\r
+               /*Set the next sibling after this one. */\r
+               void  setNextSibling(AST n);\r
+               /*Set the token text for this node */\r
+               void  setText(string text);\r
+               /*Set the token type for this node */\r
+               void  setType(int ttype);\r
+               string ToString();\r
+               string ToStringList();\r
+               string ToStringTree();\r
+       }\r
+       \r
+}
\ No newline at end of file