public FastSimpleExpressionParser(ITokenStream input, RecognizerSharedState state)
		: base(input, state)
	{
		InitializeTreeAdaptor();
		if ( TreeAdaptor == null )
			TreeAdaptor = new CommonTreeAdaptor();
	}
	public AssemblerLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state)
	{


		OnCreated();
	}
	public MessageContractsLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state)
	{


		OnCreated();
	}
Example #4
0
	public NCalcLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state)
	{


		OnCreated();
	}
Example #5
0
        public RecognizerSharedState(RecognizerSharedState state)
        {
            if (state == null)
            {
                throw new ArgumentNullException("state");
            }

            following      = (BitSet[])state.following.Clone();
            _fsp           = state._fsp;
            errorRecovery  = state.errorRecovery;
            lastErrorIndex = state.lastErrorIndex;
            failed         = state.failed;
            syntaxErrors   = state.syntaxErrors;
            backtracking   = state.backtracking;

            if (state.ruleMemo != null)
            {
                ruleMemo = (IDictionary <int, int>[])state.ruleMemo.Clone();
            }

            token = state.token;
            tokenStartCharIndex          = state.tokenStartCharIndex;
            tokenStartCharPositionInLine = state.tokenStartCharPositionInLine;
            channel = state.channel;
            type    = state.type;
            text    = state.text;
        }
Example #6
0
		public BaseRecognizer(RecognizerSharedState state)
		{
			if ( state==null ) {
				state = new RecognizerSharedState();
			}
			this.state = state;
		}
	public FuncProtoToShimLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state)
	{


		OnCreated();
	}
	public UniAspectLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state)
	{


		OnCreated();
	}
Example #9
0
 public BaseRecognizer(RecognizerSharedState state)
 {
     if (state == null)
     {
         state = new RecognizerSharedState();
     }
     this.state = state;
 }
Example #10
0
	public ExprParser(ITokenStream input, RecognizerSharedState state)
		: base(input, state)
	{
		ITreeAdaptor treeAdaptor = default(ITreeAdaptor);
		CreateTreeAdaptor(ref treeAdaptor);
		TreeAdaptor = treeAdaptor ?? new CommonTreeAdaptor();
		OnCreated();
	}
Example #11
0
		public ProfileGrammarParser( ITokenStream input, IDebugEventListener dbg, RecognizerSharedState state )
			: base( input, dbg, state )
		{
			Profiler p = (Profiler)dbg;
			p.setParser(this);
			ITreeAdaptor adap = new CommonTreeAdaptor();
			TreeAdaptor = adap;
			proxy.TreeAdaptor = adap;
		}
Example #12
0
 // overcome bug in ANTLR 3.2
 public TemplateParser(ITokenStream input, RecognizerSharedState state, ICodeGenerator gen, TemplateName enclosingTemplateName)
     : base(null, null)
 {
     this.input = input;
     this.state = state;
     if (gen != null)
         this.gen = gen;
     this._enclosingTemplateName = enclosingTemplateName;
 }
Example #13
0
 public BaseRecognizer( RecognizerSharedState state )
 {
     if ( state == null )
     {
         state = new RecognizerSharedState();
     }
     this.state = state;
     Initialize();
     InitDFAs();
 }
Example #14
0
 public BaseRecognizer(RecognizerSharedState state)
 {
     if (state == null)
     {
         state = new RecognizerSharedState();
     }
     this.state = state;
     Initialize();
     InitDFAs();
 }
Example #15
0
	public TestParser(ITokenStream input, RecognizerSharedState state)
		: base(input, state)
	{
		this.state.ruleMemo = new System.Collections.Generic.Dictionary<int, int>[12+1];


		CstBuilderForAntlr3 treeAdaptor = default(CstBuilderForAntlr3);
		CreateTreeAdaptor(ref treeAdaptor);
		TreeAdaptor = treeAdaptor;
		OnCreated();
	}
		public DebugTreeGrammar( ITreeNodeStream input, int port, RecognizerSharedState state )
			: base( input, state )
		{
			DebugEventSocketProxy proxy = new DebugEventSocketProxy( this, port, input.TreeAdaptor );
			DebugListener = proxy;
			try
			{
				proxy.Handshake();
			}
			catch ( IOException ioe )
			{
				ReportError( ioe );
			}
		}
Example #17
0
        public InterpParser(ITokenStream input, int port, RecognizerSharedState state)
            : base(input, state) {
            InitializeCyclicDFAs(dbg);

            DebugEventSocketProxy proxy = new DebugEventSocketProxy(this, port, adaptor);
            DebugListener = proxy;
            TokenStream = new DebugTokenStream(input,proxy);
            try {
                proxy.Handshake();
            } catch (IOException ioe) {
                ReportError(ioe);
            }
            ITreeAdaptor adap = new CommonTreeAdaptor();
            TreeAdaptor = adap;
            proxy.TreeAdaptor = adap;
        }
 public TreeRewriter(ITreeNodeStream input, RecognizerSharedState state) : base(input, state)
 {
     Func<IAstRuleReturnScope> func = null;
     Func<IAstRuleReturnScope> func2 = null;
     this.originalAdaptor = input.TreeAdaptor;
     this.originalTokenStream = input.TokenStream;
     if (func == null)
     {
         func = () => this.Topdown();
     }
     this.topdown_func = func;
     if (func2 == null)
     {
         func2 = () => this.Bottomup();
     }
     this.bottomup_func = func2;
 }
Example #19
0
		public DebugGrammarParser( ITokenStream input, int port, RecognizerSharedState state )
			: base( input, state )
		{
			DebugEventSocketProxy proxy = new DebugEventSocketProxy( this, port, adaptor );
			DebugListener = proxy;
            // TODO: I had to manually correct this line from ITokenStream
			TokenStream = new DebugTokenStream( input, proxy );
			try
			{
				proxy.Handshake();
			}
			catch ( IOException ioe )
			{
				ReportError( ioe );
			}
			ITreeAdaptor adap = new CommonTreeAdaptor();
			TreeAdaptor = adap;
			proxy.TreeAdaptor = adap;
		}
 public RecognizerSharedState(RecognizerSharedState state)
 {
     if (state == null)
     {
         throw new ArgumentNullException("state");
     }
     this.following = (BitSet[]) state.following.Clone();
     this._fsp = state._fsp;
     this.errorRecovery = state.errorRecovery;
     this.lastErrorIndex = state.lastErrorIndex;
     this.failed = state.failed;
     this.syntaxErrors = state.syntaxErrors;
     this.backtracking = state.backtracking;
     if (state.ruleMemo != null)
     {
         this.ruleMemo = (IDictionary<int, int>[]) state.ruleMemo.Clone();
     }
     this.token = state.token;
     this.tokenStartCharIndex = state.tokenStartCharIndex;
     this.tokenStartCharPositionInLine = state.tokenStartCharPositionInLine;
     this.channel = state.channel;
     this.type = state.type;
     this.text = state.text;
 }
Example #21
0
        public BonsaiTree(ITreeNodeStream input, RecognizerSharedState state)
    		: base(input, state) {
            InitializeCyclicDFAs();

             
        }
Example #22
0
 public BaseRecognizer()
 {
     state = new RecognizerSharedState();
     Initialize();
     InitDFAs();
 }
Example #23
0
		public BaseRecognizer()
		{
			state = new RecognizerSharedState();
		}
	public CSharpNamesLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state)
	{

		OnCreated();
	}
Example #25
0
	public JavaParser(ITokenStream input, RecognizerSharedState state)
		: base(input, state)
	{
		this.state.ruleMemo = new System.Collections.Generic.Dictionary<int, int>[400+1];


		ITreeAdaptor treeAdaptor = default(ITreeAdaptor);
		CreateTreeAdaptor(ref treeAdaptor);
		TreeAdaptor = treeAdaptor ?? new CommonTreeAdaptor();
		OnCreated();
	}
Example #26
0
    public SpecFlowLangLexer_en(ICharStream input, RecognizerSharedState state)
		: base(input, state) {
		InitializeCyclicDFAs(); 

    }
Example #27
0
 public BaseRecognizer()
 {
     state = new RecognizerSharedState();
 }
Example #28
0
 public TemplateName CompileAnonTemplate(TemplateName enclosingTemplateName, ITokenStream input, IList<IToken> ids, RecognizerSharedState state)
 {
     TemplateCompiler c = new TemplateCompiler();
     c.Compile(input, state);
     return null;
 }
Example #29
0
	public FlashTeaseScriptLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state)
	{


		OnCreated();
	}
Example #30
0
 public virtual void SetState(RecognizerSharedState value)
 {
     this.state = value;
 }
Example #31
0
 public Lexer(ICharStream input, RecognizerSharedState state)
     : base(state)
 {
     this.input = input;
 }
Example #32
0
        public InterpParser(ITokenStream input, RecognizerSharedState state)
    		: base(input, state) {
            InitializeCyclicDFAs();

             
       }
Example #33
0
 public virtual object ApplyOnce(object t, RuleDelegate whichRule)
     {
     originalAdaptor.ClearChanged();
     
     if (t==null)
         return null;
     //
     Debug.Assert(this.BacktrackingLevel == 0);
     try {
         // Share TreeParser object but not parsing-related state
         //
         state = new RecognizerSharedState();
         input = new CommonTreeNodeStream(originalAdaptor, t);
         ((CommonTreeNodeStream)input).TokenStream = originalTokenStream;
         //
         this.BacktrackingLevel = 1;
         //
         Debug.Assert(!this.Failed());
         TreeRuleReturnScope r = whichRule((NadirAST)t);
         //
         return (r==null ? null : r.Tree);
         }
     catch (RecognitionException) 
         {
         }
     finally
         {
         this.BacktrackingLevel = 0;
         }
     return t;
     }
		public AntlrCalcEngineParser( ITokenStream input, RecognizerSharedState state )
				: base( input, state )
		{
			InitializeCyclicDFAs();
		}
Example #35
0
 public NadirTreeFilter(ITreeNodeStream input, RecognizerSharedState state) : base(input, state)
     {
     }
Example #36
0
 public TemplateName CompileRegion(TemplateName enclosingTemplateName, string regionName, ITokenStream input, RecognizerSharedState state)
 {
     TemplateCompiler c = new TemplateCompiler();
     c.Compile(input, state);
     return null;
 }
Example #37
0
 public Parser(ITokenStream input, RecognizerSharedState state)
     : base(state)
 {
     this.input = input;
 }
Example #38
0
    public TemplateLexer(ICharStream input, RecognizerSharedState state)
		: base(input, state) {
		InitializeCyclicDFAs(); 

    }
Example #39
0
 public Parser(ITokenStream input, RecognizerSharedState state)
     : base(state)             // share the state object with another parser
 {
     this.input = input;
 }