Пример #1
0
		public ReduceEventArgs(Rule rule, NonterminalToken token, State newState)
		{
			this.rule = rule;
			this.token = token;
			this.newState = newState;
			this.contin = true;
		}
Пример #2
0
 /// <summary>
 /// Creates a new LALR parser.
 /// </summary>
 /// <param name="tokenizer">A tokenizer.</param>
 /// <param name="states">The LALR states.</param>
 /// <param name="startState">The starting state.</param>
 /// <param name="symbols"></param>
 public LALRParser(IStringTokenizer tokenizer, StateCollection states, State startState, SymbolCollection symbols)
 {
     this.tokenizer = tokenizer;
     this.states = states;
     this.startState = startState;
     this.symbols = symbols;
     storeTokens = StoreTokensMode.NoUserObject;
 }
Пример #3
0
		/// <summary>
		/// Creates a new LALR parser.
		/// </summary>
		/// <param name="tokenizer">A tokenizer.</param>
		/// <param name="states">The LALR states.</param>
		/// <param name="startState">The starting state.</param>
		public LALRParser(IStringTokenizer tokenizer,
			StateCollection states,
			State startState)
		{
			this.tokenizer = tokenizer;
			this.states = states;
			this.startState = startState;
			this.trimReductions = trimReductions;
			storeTokens = StoreTokensMode.NoUserObject;
		}
Пример #4
0
		/// <summary>
		/// Creates a new goto action. 
		/// </summary>
		/// <param name="symbol">The symbol that a reduction must be so that
		/// the goto action will be done.</param>
		/// <param name="state">The new current state for the LALR parser.</param>
		public GotoAction(SymbolNonterminal symbol, State state)
		{
			this.symbol = symbol;
			this.state = state;
		}
Пример #5
0
 public void Add(State state)
 {
     list.Add(state);
 }
Пример #6
0
		/// <summary>
		/// Pushes a state on top of the stack.
		/// </summary>
		/// <param name="state"></param>
		public virtual void Push(State state)
		{
			stack.Push(state);
		}
Пример #7
0
 public ShiftEventArgs(TerminalToken token, State newState)
 {
     this.token = token;
     this.newState = newState;
 }
Пример #8
0
 public GotoEventArgs(SymbolNonterminal symbol, State newState)
 {
     this.symbol = symbol;
     this.newState = newState;
 }
Пример #9
0
		/// <summary>
		/// Creates a new shift action.
		/// </summary>
		/// <param name="symbol">The symbol that the token must be for this action to be done.</param>
		/// <param name="state">The new current state for the LALR parser.</param>
		public ShiftAction(SymbolTerminal symbol, State state)
		{
			this.symbol = symbol;
			this.state = state;
		}