This class is responsible for parsing a Velocity template. This class was generated by JavaCC using the JJTree extension to produce an Abstract Syntax Tree (AST) of the template. Please look at the Parser.jjt file which is what controls the generation of this class.
예제 #1
0
		public void Test_Parse()
		{
			VelocityCharStream vcs = GetTemplateStream();
			Parser p = new Parser(vcs);

			SimpleNode root = p.Process();

			String javaNodes = "19,18,9,5,23,56,23,42,23,24,6,18,56,18,9,5,23,56,23,42,23,25,6,18,44,23,5,56,6,18,46,18,43,0";
			String nodes = String.Empty;

			if (root != null)
			{
				Token t = root.FirstToken;
				nodes += t.Kind.ToString();
				while (t != root.LastToken)
				{
					t = t.Next;
					nodes += "," + t.Kind.ToString();
				}
			}

			if (!javaNodes.Equals(nodes))
			{
				Console.Out.WriteLine("");
				Console.Out.WriteLine(".Net parsed nodes did not match java nodes.");
				Console.Out.WriteLine("java=" + javaNodes);
				Console.Out.WriteLine(".net=" + nodes);
				Assert.Fail(".Net parsed nodes did not match java nodes.");
			}
		}
예제 #2
0
	public ASTNotNode(Parser p, int id):base(p, id) {}
예제 #3
0
	public ASTReference(Parser p, int id):base(p, id) {}
예제 #4
0
	public ASTElseIfStatement(Parser p, int id):base(p, id) {}
예제 #5
0
		/// <summary> Returns a JavaCC generated Parser.
		/// </summary>
		/// <returns>Parser javacc generated parser
		/// </returns>
		public Parser.Parser CreateNewParser()
		{
			Parser.Parser parser = new Parser.Parser(this);
			parser.Directives = directiveManager;
			return parser;
		}
예제 #6
0
	public ASTIncludeStatement(Parser p, int id):base(p, id) {}
예제 #7
0
	public ASTMethod(Parser p, int id):base(p, id) {}