yytext in POSIX lex

amin@unirsvl.RSVL.UNISYS.COM
Wed, 3 Feb 1993 14:49:17 GMT

          From comp.compilers

Related articles
yytext in POSIX lex amin@unirsvl.RSVL.UNISYS.COM (1993-02-03)
Re: yytext in POSIX lex schrod@iti.informatik.th-darmstadt.de (1993-02-04)
Re: yytext in POSIX lex vern@daffy.ee.lbl.gov (1993-02-05)
| List of all articles for this month |

Newsgroups: comp.compilers
From: amin@unirsvl.RSVL.UNISYS.COM
Keywords: lex, question, comment
Organization: Compilers Central
Date: Wed, 3 Feb 1993 14:49:17 GMT

In an earlier post to comp.compilers, I solicited help from the net to
test the POSIX extensions to lex and yacc. Few people responded to my
request due to the lack of existing POSIX implementations of lex and yacc.
Thank you to one and all for your help. John Levine, recommended his and
his colleagues' book on lex and yacc, second edition. A very good book
indeed. I was able to construct test cases for exclusive and inclusive
start states, collating symbols, etc ...


The one thing I am having a problem with is the %array and the %pointer.
It sounds too easy, however, I am confused due to the lack of experience
and examples describing them in the book. Moreover, I am having a tough
time coming up with a scenario where such %pointer and %array are applied
or helpful. What is the difference in real life applications? How are
they used?


Thank you much.


My news access is not very dependable, please use e-mail if possible.


Regards,
--
Amin Kassem - Unisys Corporation
System Software & Interface - R&D
e-mail: amin@rsvl.unisys.com
[Of the two major implementations of lex, AT&T lex makes yytext an array
and flex makes it a pointer. Some poorly written lexers depend on it
being one or the other, and %array and %pointer make it easier to port
such code. You have to try fairly hard to tell the difference, e.g. use
sizeof(yytext). -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.