[csparser-support] Fwd: SR
Status: Beta
Brought to you by:
vorlath
From: Cleo S. <cle...@ya...> - 2013-07-02 03:29:24
|
Hi Hamid, It is the next shift or reduce. If it a shift, then SR will be the next state. If it is a reduce, then SR will be the negative of the production ID+2. Positive SR = next state. Negitave SR = -(productionID+2) If it is positive, then it's the next state and I just push it onto the state stack called StateStack. If it is negative, then I make it positive again with -(SR+2) and grab the Production from the production table p and replace the states and tokens on the stack with said production. Note that goto tables have their own ID's (gprodID). I separated them from the production table to reduce space. Cléo -------------- From: Hamid Reza Hassanzadeh <hassanzadeh@ga...> - 2013-07-01 16:30 Hi everybody, Can somebody explain to me about the CSParser::parse() function. Specifically what is the SR variable. I need to make sense between LR(1) and the way it's implemented in that function. THanks |