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

コード例 #1
0
ファイル: Parser.cs プロジェクト: Binodesk/spring-net
		/// <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;
		}
コード例 #2
0
	static public void initializeASTFactory( ASTFactory factory )
	{
		factory.setMaxNodeType(71);
	}
コード例 #3
0
ファイル: TreeParser.cs プロジェクト: Qq247534686/DataFolder
 /*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;
 }
コード例 #4
0
	private void initializeFactory()
	{
		if (astFactory == null)
		{
			astFactory = new ASTFactory("Spring.Expressions.SpringAST");
		}
		initializeASTFactory( astFactory );
	}