Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] presentation wish list



> Actually writing parsers using the tools like flex & bison is VERY old
> school thing to do, as it's a 50 year old technology.

Indeed. The only reason for flex/bison to still exist is inertia.

In the 1960s when automated tools for parsing were first developed,
memory was very scarce and expensive and there was no virtual memory
yet.

A table driven parser always has the same program size regardless of
the size of the language it parses and it can be written to always
have the same memory footprint regardless of the size of the input
text. This is so because the state is kept in tables that could be
written out to tape and read back for another pass. The underlying
method is slow and cumbersome and painful to debug, furthermore, error
reporting is problematic.

By contrast, RD parsing is fast, straightforward, easy to implement
and debug, and error reporting is precise. However, the program size
grows with the size of the language and memory footprint grows with
the size of input text because state is kept on the stack. Back then
the hardware simply wasn't up to it for anything but small languages
like Pascal and thus table driven parsers were the only feasible
choice for most languages.

Of course in this day and age, memory is no longer scarce and
therefore RD parsing has made a comeback.

> Nowadays I always opt for using ANTLR as it makes
> the task much easier.

That sentiment is why I proposed a presentation that would introduce
the concept of recursive descent and then show how to do it both
manually and then using ANTLR, further what other benefits ANTLR has
such as the ability to visualise a grammar on the fly and find and
visualise conflicts, single step through parsed input etc etc.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links