Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support for inheritance? #38

Open
blambeau opened this Issue · 0 comments

1 participant

@blambeau
Collaborator

Hi,

I'd like to write an abstract grammar with two concrete instantiations and I expected Citrus to mimic ruby inheritance for this (I guess that Treetop does, btw). Unfortunately, the following example does not work:

grammar WithPar
  rule function
    /[a-z]/+ parens
  end
  rule parens '()' end
end

grammar WithBrack
  include WithPar
  root function
  rule parens '{}' end
end

I would expect the following to work, but it's not the case (see https://gist.github.com/1606092)

WithPar.parse "hello()"
WithBrack.parse "hello{}"

Is there a way to do this in Citrus?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.