Skip to content

Some backends do not implement the define pragma #266

@andreasabel

Description

@andreasabel

The C backend does not implement the define pragma.

EMinus. Exp  ::= Exp "-" Exp1;
EInt.   Exp1 ::= Integer;
eNeg.   Exp1 ::= "-" Exp1;

coercions Exp 1;

define eNeg e = EMinus (EInt 0) e;

For this example,

bnfc --c -m Foo.cf && make

fails at compilation of Printer.c, which treats eNeg as variant just as EInt and EMinus.

The backends Haskell, Java, CPP, OCaml do support define.

Backends that do not support define:

  • Haskell --functor
  • C
  • Java/ANTLR
  • C++ NoSTL: Skeleton.C does not compile
  • C++ with namespace

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions