Skip to content

Some backends do not implement the define pragma #266

Closed

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

Activity

  1. added
    define
    on Jan 3, 2020
  2. changed the title [-]C backend does not implement `define` pragma[/-] [+]Some backends do not implement the `define` pragma[/+] on Jan 3, 2020
  3. self-assigned this
    on Jan 3, 2020
  4. added this to the 2.8.4 milestone on Jan 3, 2020
  5. added 6 commits that reference this issue on Jan 3, 2020
  6. added 3 commits that reference this issue on Jan 4, 2020
  7. added 4 commits that reference this issue on Apr 1, 2021
  8. added a commit that references this issue on Dec 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CJava/ANTLRdefineenhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions