Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001314OCamlOCaml generalpublic2002-08-09 16:482002-08-19 10:32
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001314: Bug in Parsing library?
DescriptionWhen entering parsing the second time in the same program run and calling
the symbol_start function at the first rule it returns the last symbol_end
position from the previous run through the parser (altough I expected it to
return 0).

Is it supposed to work only once, or is there something I'm missing?

Maybe it should clear the whole Parsing.env when calling clear_parser?

- Kimmo

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0002547)
administrator (administrator)
2002-08-19 10:31

> When entering parsing the second time in the same program run and calling
> the symbol_start function at the first rule it returns the last symbol_end
> position from the previous run through the parser (altough I expected it to
> return 0).
> Is it supposed to work only once, or is there something I'm missing?

Location information (Parsing.symbol_start) is derived from the
location information contained in lexing buffers (Lexing.lexbuf).
If you reuse the same lexing buffer across several calls to a parser,
locations keep increasing. If this behavior is inadequate, use a
fresh lexbuf to start again from 0.

> Maybe it should clear the whole Parsing.env when calling clear_parser?

This will have no effect on location information.

Hope this helps,

- Xavier Leroy

(0002548)
administrator (administrator)
2002-08-19 10:32

Normal behavior if lexbuf is reused.

- Issue History
Date Modified Username Field Change
2005-11-18 10:14 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker