Esempio n. 1
0
        public ProductionList ReduceProductions = new ProductionList(); //may be more than one, in case of conflict

/*    //used for shift actions
 *  internal ActionRecord(string key, ParserState newState) {
 *    //Input = input;
 *    Key = key; // input.Key;
 *    NewState = newState;
 *    ActionType = ParserActionType.Shift;
 *  }
 *  //used for reduce actions
 *  internal ActionRecord(string key, Production reduceProduction) {
 *    //Input = input;
 *    Key = key; // input.Key;
 *    ReduceProductions.Add(reduceProduction);
 *    ActionType = ParserActionType.Reduce;
 *  }
 */
        internal ActionRecord(string key, ParserActionType type, ParserState newState, Production reduceProduction)
        {
            this.Key        = key;
            this.ActionType = type;
            this.NewState   = newState;
            if (reduceProduction != null)
            {
                ReduceProductions.Add(reduceProduction);
            }
        }
Esempio n. 2
0
 public ActionRecord CreateDerived(ParserActionType type, Production reduceProduction)
 {
     return(new ActionRecord(this.Key, type, this.NewState, reduceProduction));
 }