linkrope / gamma

Extended Affix Grammar Compiler Generator
Boost Software License 1.0
4 stars 1 forks source link

The compiler generator reports errors even if a compiler is created successfully #15

Closed kuniss closed 1 year ago

kuniss commented 1 year ago

The compiler generator reports errors for LEAG and SingleSweep evaluator generation even if the SOAG evaluator generator can be created and, in fact, will be created.

A good example is example/count2.eag. It is neither a LEAG grammar nor an Singe Sweep grammar, but a SOAG evaluator can be generated and also will be, in fact:

denis@modula:~/git/gamma$ ./gamma example/count2.eag 
info: Epsilon 1.02   JoDe/SteWe  22.11.96
info: SOAG-Evaluatorgenerator 1.06 dk 14.03.98
info: Analysing S
info: S grammar is valid
info: predicates in S: 1
info: ELL(1) testing S
info: S grammar is ELL(1)
info: SLAG testing S
error: not left-defining
example/count2.eag:6:7     A<N, N, Z>.
                             ^
info: S grammar is no LAG
info: single-sweep testing S
error: alternative is not single sweep
example/count2.eag:5:10 S <+Z: Z>:
                                 ^
info: LexGen writing S
info: predicates in S: 1
info: grammar is SOAG
info: SOAG writing S
info: optimize
info: +rc +ct
info: ELL(1) writing parser of S
info: -rc -ct
info: dmd S.d SEval.d SLex.d -g include/runtime.d src/io.d src/log.d src/epsilon/soag/listacks.d
denis@modula:~/git/gamma$

This causes problems upstream in the EAG grammar extension as reported under kuniss/epsilon-ide-extensions#5.

A solution could be to report these issues not as errors but as warnings or infos as long as the particular evaluator class has not been explicitly requested via command line option by the user.

kuniss commented 1 year ago

Solved in the Epsilon IDE extension v2.3.0 by making the evaluator generator type configurable and SOAG the default. Gamma remained unchanged.