Simple precedence parser: Difference between revisions

Content deleted Content added
Qsebas (talk | contribs)
No edit summary
Qsebas (talk | contribs)
No edit summary
Line 10:
* While not (Stack equals to $S and Input equals to $) (S = Initial simbol of the grammar)
** Search in the table the relationship between Top(stack) and NextToken(Input)
** if the relationship is <Math> \dot =</math> or <Math> \dot <lessdot</math>
*** '''Shift''':
*** Push(Stack, relationship)
Line 24:
 
SearchProductionToReduce (Stack)
* search the '''Pivot''' in the stack the nearest <Math> \dot <lessdot</math> from the top
* search in the productions of the grammar wich one have the same right side than the '''Pivot'''
 
Line 56:
| F || || || || || ||<math>\gtrdot</math>||<math>\gtrdot</math>|| ||<math>\gtrdot</math>|| ||<math>\gtrdot</math>
|-
| + || || ||<math>\dot <lessdot</math>||<math>\dot =</math>||<math>\dot <lessdot</math>|| || ||<math>\dot <lessdot</math>|| ||<math>\dot <lessdot</math> ||
|-
| * || || || || ||<math>\dot =</math>|| || ||<math>\dot <lessdot</math>|| ||<math>\dot <lessdot</math> ||
|-
| ( ||<math>\dot <lessdot</math>||<math>\dot =</math>||<math>\dot <lessdot</math>||<math>\dot <lessdot</math>||<math>\dot <lessdot</math>|| || ||<math>\dot <lessdot</math>|| ||<math>\dot <lessdot</math> ||
|-
| ) || || || || || || ||<math>\gtrdot</math>|| ||<math>\gtrdot</math>|| ||<math>\gtrdot</math>
Line 66:
| num|| || || || || ||<math>\gtrdot</math>||<math>\gtrdot</math>||||<math>\gtrdot</math>|| ||<math>\gtrdot</math>
|-
| $ ||<math>\dot <lessdot</math>|| ||<math>\dot <lessdot</math>||<math>\dot <lessdot</math>||<math>\dot <lessdot</math>|| || ||<math>\dot <lessdot</math>|| ||<math>\dot <lessdot</math> ||
|}