Problem with rules order #25

Closed
douglascamata opened this Issue Feb 9, 2012 · 4 comments

Projects

None yet

2 participants

@douglascamata

I have my rules defined like this:

grammar Language

  rule integer
    [0-9]+
  end

  rule identifier
    [a-z]+
  end

end

And when I try to parse any number, it's fine. But, when I try to parse any identifier, it don't work. Then, I inverted the rules and tried again, guess what? I was able do parse identifiers and not integers. Somebody know what's happening here?

@cjheath
Collaborator
@douglascamata

Worked like a charm. Thank you.

@cjheath
Collaborator
@douglascamata

Thanks for the tips, I'm developing a compiler to something like a mix of Pascal and C for my college compiler's class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment