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...

Exemple #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;
		}
	static public void initializeASTFactory( ASTFactory factory )
	{
		factory.setMaxNodeType(71);
	}
Exemple #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;
 }
	private void initializeFactory()
	{
		if (astFactory == null)
		{
			astFactory = new ASTFactory("Spring.Expressions.SpringAST");
		}
		initializeASTFactory( astFactory );
	}