ooc-lang / greg

:ram: a recursive-descent parser generator for PEG
93 stars 30 forks source link

How to include more than one parser in a program? #20

Closed fletcher closed 9 years ago

fletcher commented 9 years ago

I am creating a quick and dirty test program around my parser built with greg. In order to parse the test files, it's easiest to do by building another parser.

Since both parsers are built with greg, there are namespace collisions:

duplicate symbol _yyparse_from in:
    test.o
    parser.o
duplicate symbol _yyparse in:
    test.o
    parser.o
duplicate symbol _yyinit in:
    test.o
    parser.o
duplicate symbol _yydeinit in:
    test.o
    parser.o
duplicate symbol _yyparse_new in:
    test.o
    parser.o
duplicate symbol _yyparse_free in:
    test.o
    parser.o

Any tips on how to make this work? Surely it is possible to use more than one parser in a given program?

Any advice is appreciated!!

fletcher commented 9 years ago

And of course, after hitting send I discovered the YY_NAME macro....

Thanks, and sorry for posting this 30 seconds too soon!

nddrylliog commented 9 years ago

No problem, glad you could find what you were looking for :)

On Sat, Feb 14, 2015 at 12:13 AM, Fletcher T. Penney < notifications@github.com> wrote:

Closed #20 https://github.com/fasterthanlime/greg/issues/20.

— Reply to this email directly or view it on GitHub https://github.com/fasterthanlime/greg/issues/20#event-235735978.