Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!mips!lai From: lai@mips.COM (David Lai) Newsgroups: comp.sys.mips Subject: Re: MIPS YACC commedations and question Message-ID: <32377@gumby.mips.COM> Date: 29 Nov 89 17:26:24 GMT References: <2168@cs-spool.calgary.UUCP> Reply-To: lai@mips.COM (David Lai) Distribution: na Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 36 In article <2168@cs-spool.calgary.UUCP> cliff@.UCalgary.CA (Cliff Marcellus) writes: > > Well now the (not so) down side... does anyone know what a configuration > in a state of the form : > > expression : expression PLUSOP $$56 error > > means? (I don't know what "$$56" is supposed to do for me, and it's > not in the documentation -- at least I can't find it.) >-- >Cliff Marcellus UUCP : {any backbone}!calgary!ssg-vax-a!cliff >Dept of Physics and Astronomy DOMAIN : cliff@ssg-vax-a.phys.UCalgary.CA >The University of Calgary SPAN : CANCAL::CLIFF The $$56 is a generated reduction resulting from an action embedded in the reduction rule, ie: expression: expression PLUSOP { a=12; b=13; $$=100; } error { $$ = $3; } ; would be translated to two reductions: expression: expression PLUSOP $$1 error { $$=$3; } ; $$1: { a=12; b=13; $$=100; } ; The value of $$1 in the first rule's action ($3) is the value assigned to $$ in the second rule's action. -- "What is a DJ if he can't scratch?" - Uncle Jamms Army David Lai (lai@mips.com || {ames,prls,pyramid,decwrl}!mips!lai)