[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Brug af flex og bison



Hej Kodehajer!

Jeg har siddet og fedtet lidt med flex og bison, og jeg støder ind i
ting jeg ikke forstår :-(

Jeg forsøger som en start at lave en simpel parser der kan genkende
ord og whitespace, og som udskriver disse tokens i quotes ''.

Når jeg endelig engang får hul på bylden vil jeg gerne kunne samle
delte ord som: "par- ser" eller "par -ser" til ordet "par-ser".
Dette volder mig imidlertid en del problemer, og jeg vil meget gerne
have hjælp til at komme videre.

Herunder er filerne parser.y simple.lex main.c og makefile
inkluderet. Hvad jeg ikke forstår i dette program er hvorfor
tokens af typen WORD udskrives sammen med efterfølgende whitespace:

eks:
# ./parser
hello world heh
'hello '
' '
'world '
' '
^D

'hello ' burde være 'hello' som jeg har forstået det...?

Måske involverer problemet at YYSTYPE er sat til char*.

Der sandsynligvis er der noget jeg misser,.. kommentarer?

Venlig Hilsen
   Anders

PS: Måske er det bedre at henvende sig til sslug-prog listen?

-- 
"Your momma! Now shut up and drag me to work." -Bender


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *