ometa-js icon indicating copy to clipboard operation
ometa-js copied to clipboard

Implement foreign rules

Open CoderPuppy opened this issue 12 years ago • 3 comments

Fixes #17

This adds a magic rule called foreign and adds it to the compiler.

I couldn't figure out what to do with super rules.

CoderPuppy avatar Feb 15 '13 21:02 CoderPuppy

@CoderPuppy - I realize this is a long time ago, but do you recall how to use this?

aneilbaboo avatar Mar 11 '18 16:03 aneilbaboo

@aneilbaboo: I looked back through it and I'm pretty sure it works like this:

grammar A {
  a = "a"
}

grammar B {
  b = "b",
  ab = A.a | b
}

then B.ab would match a or b

CoderPuppy avatar Mar 11 '18 19:03 CoderPuppy

Ah, just like the spec. Thanks @CoderPuppy.

For any future readers - it looks like https://github.com/Page-/ometa-js has foreign rule syntax working, and is still being maintained.

aneilbaboo avatar Mar 12 '18 15:03 aneilbaboo