[Lazarus] How to write an eficient lexical scanner/parser?

silvioprog silvioprog at gmail.com
Fri Mar 13 20:28:07 CET 2015


On Wed, Mar 11, 2015 at 6:38 AM, leledumbo <leledumbo_cool at yahoo.co.id>
wrote:

> > However, I have a question: is there any article about 'how to write
> lexical parsers' using Object Pascal?
>
> First, you need to differentiate them correctly. Lexical scanner (or simply
> lexer) and parser, not lexical parser :)
>
> I've written some simple languages, generating GraphViz, LLVM or C code,
> using both self learning reference from the almighty Prof. Niklaus Wirth's
> articles, Jack Crenshaw's, the legendary dragon book and many others plus
> my
> compiler course in college.
>
> I really really suggest Prof. Niklaus Wirth's one
> (http://www.inf.ethz.ch/personal/wirth/, click the Compiler Construction
> link) as it's concise, simple, doesn't use stupid generator (i.e.: easy to
> implement by hand) while covering most important parts of the subject.
> While
> he didn't use or stress or even discourage the usage of abstract syntax
> tree, he did explain it that's good enough to understand.
>
> Here's what I've written in the past and is publicly available:
> - https://bitbucket.org/leledumbo/erd-maker (generates GraphViz code for
> ERD
> visualization)
> - https://bitbucket.org/leledumbo/linguc (generates LLVM code that can be
> compiled as a library for a mathematically provable language focusing in
> database driven application)
>
> I don't use the direct code generation approach anymore as I found the
> abstract syntax tree to be usable for more than just code generation.
>

Buddy, thanks alot for that information. I'll take a look at this! =)

--
Silvio Cl├ęcio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150313/c29140a7/attachment-0003.html>


More information about the Lazarus mailing list