[SableCC] dispose of the parsed result

View: New views
3 Messages — Rating Filter:   Alert me  

[SableCC] dispose of the parsed result

by Victor Neumann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I'd like to parse files which are much larger than my target memory  
footprint. The files are composed of many small independently parsable  
chunks. I only need to parse one of these chunks at a time, dispose of  
the parsed result, then parse the next chunk.

Does your library support this type of parsing? Is there a way to only  
consume memory on the order of the size of the rule I'm attempting to  
parse, and not on the order of the size of the file?

Thanks for any tips!



_______________________________________________
SableCC-Discussion mailing list
SableCC-Discussion@...
http://lists.sablecc.org/listinfo/sablecc-discussion

Re: [SableCC] dispose of the parsed result

by Etienne M. Gagnon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Victor,

Currently, this is not supported by SableCC.

Etienne

Victor Neumann a écrit :

> Hello,
>
> I'd like to parse files which are much larger than my target memory
> footprint. The files are composed of many small independently parsable
> chunks. I only need to parse one of these chunks at a time, dispose of
> the parsed result, then parse the next chunk.
>
> Does your library support this type of parsing? Is there a way to only
> consume memory on the order of the size of the rule I'm attempting to
> parse, and not on the order of the size of the file?
>
> Thanks for any tips!
>
>
>
> _______________________________________________
> SableCC-Discussion mailing list
> SableCC-Discussion@...
> http://lists.sablecc.org/listinfo/sablecc-discussion
>

--
Etienne M. Gagnon, Ph.D.
SableCC:                                            http://sablecc.org


_______________________________________________
SableCC-Discussion mailing list
SableCC-Discussion@...
http://lists.sablecc.org/listinfo/sablecc-discussion

Re: [SableCC] dispose of the parsed result

by Daniel Penning-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

You should try to overload your lexer and let the methods next() and
peek() return a new eof-token whenever you get the last token of a
chunk. Just continue parsing chunks from the lexer until you reach the
real eof.

Daniel

Victor Neumann schrieb:

> Hello,
>
> I'd like to parse files which are much larger than my target memory
> footprint. The files are composed of many small independently parsable
> chunks. I only need to parse one of these chunks at a time, dispose of
> the parsed result, then parse the next chunk.
>
> Does your library support this type of parsing? Is there a way to only
> consume memory on the order of the size of the rule I'm attempting to
> parse, and not on the order of the size of the file?
>
> Thanks for any tips!
>
>
>
> _______________________________________________
> SableCC-Discussion mailing list
> SableCC-Discussion@...
> http://lists.sablecc.org/listinfo/sablecc-discussion
>


_______________________________________________
SableCC-Discussion mailing list
SableCC-Discussion@...
http://lists.sablecc.org/listinfo/sablecc-discussion