aboutsummaryrefslogtreecommitdiffstats
path: root/lib/parsetools
diff options
context:
space:
mode:
authorgarrett <[email protected]>2011-08-18 09:50:14 -0500
committergarrett <[email protected]>2011-08-18 10:38:42 -0500
commitf5c2fe153db22cfaabf263091f4f073c26ed5480 (patch)
treec648f8668db49bddb666bb9381774cf5365540cf /lib/parsetools
parent90fb6ccf9292c909a0639f3874b36a1805204bc8 (diff)
downloadotp-f5c2fe153db22cfaabf263091f4f073c26ed5480.tar.gz
otp-f5c2fe153db22cfaabf263091f4f073c26ed5480.tar.bz2
otp-f5c2fe153db22cfaabf263091f4f073c26ed5480.zip
Fix incorrect order of pseudo variables in yecc example
The example is for converting from infix to prefix. This change uses to correct ordering of the triplet.
Diffstat (limited to 'lib/parsetools')
-rw-r--r--lib/parsetools/doc/src/yecc.xml8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/parsetools/doc/src/yecc.xml b/lib/parsetools/doc/src/yecc.xml
index c712609cf4..1d2a985d7d 100644
--- a/lib/parsetools/doc/src/yecc.xml
+++ b/lib/parsetools/doc/src/yecc.xml
@@ -425,9 +425,9 @@ myparser:parse_and_scan({Mod, Tokenizer, Args}) </code>
Nonterminals E T F.
Terminals '+' '*' '(' ')' number.
Rootsymbol E.
-E -> E '+' T: ['$1', '$2', '$3'].
+E -> E '+' T: ['$2', '$1', '$3'].
E -> T : '$1'.
-T -> T '*' F: ['$1', '$2', '$3'].
+T -> T '*' F: ['$2', '$1', '$3'].
T -> F : '$1'.
F -> '(' E ')' : '$2'.
F -> number : '$1'. </code>
@@ -438,8 +438,8 @@ Terminals '+' '*' '(' ')' number.
Rootsymbol E.
Left 100 '+'.
Left 200 '*'.
-E -> E '+' E : ['$1', '$2', '$3'].
-E -> E '*' E : ['$1', '$2', '$3'].
+E -> E '+' E : ['$2', '$1', '$3'].
+E -> E '*' E : ['$2', '$1', '$3'].
E -> '(' E ')' : '$2'.
E -> number : '$1'. </code>
<p>3. An overloaded minus operator:</p>