AST Support code shared by TreeParser and Parser.

We use delegation to share code (and have only one bit of code to maintain) rather than subclassing or superclassing (forces AST support code to be loaded even when you don't want to do AST stuff).

Typically, setASTNodeType is used to specify the homogeneous type of node to create, but you can override create() to make heterogeneous nodes etc...

Ejemplo n.º 1
0
		/// <summary>
		/// Specify an object with support code (shared by Parser and TreeParser.
		/// Normally, the programmer does not play with this, using 
		/// <see cref="setASTNodeClass"/> instead.
		/// </summary>
		/// <param name="f"></param>
		public virtual void  setASTFactory(ASTFactory f)
		{
			astFactory = f;
		}
Ejemplo n.º 2
0
	static public void initializeASTFactory( ASTFactory factory )
	{
		factory.setMaxNodeType(71);
	}
Ejemplo n.º 3
0
 /*Specify an object with support code (shared by
  *  Parser and TreeParser.  Normally, the programmer
  *  does not play with this, using setASTNodeType instead.
  */
 public virtual void  setASTFactory(ASTFactory f)
 {
     astFactory = f;
 }
Ejemplo n.º 4
0
	private void initializeFactory()
	{
		if (astFactory == null)
		{
			astFactory = new ASTFactory("Spring.Expressions.SpringAST");
		}
		initializeASTFactory( astFactory );
	}