«« ( Date ) »» // «« ( Thread ) »» // ri4pp - 2005

Re: Nekoliko pitanja

by Marko Ninkovic
nedelja, 24. april 2005 - 00:07.

Dana Sat, 23 Apr 2005 22:37:44 +0200, Zeljko Nase <ZNase@Sezampro.yu> napisa:


1. Kako vracati poziciju tokena radi obrade u CUP-u?

Ovo mogu da uradim jedino ako iskoristim neko ili oba polja LEFT i RIGHT
u okviru java_cup.runntime.Symbol-a, a nisam siguran da li su one potrebne
parseru kako bi pravilno radio.


For each label, two more variables accessible to the user are declared. A left and right value labels are passed to the code string, so that the user can find out where the left and right side of each terminal or non-terminal is in the input stream. The name of these variables is the label name, plus left or right. for example, given the right hand side of a production expr:e1 PLUS expr:e2 the user could not only access variables e1 and e2, but also e1left, e1right, e2left and e2right. these variables are of type int.