Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When two similar expression get selected, not working. #22

Closed
senyan opened this issue Nov 18, 2014 · 3 comments
Closed

When two similar expression get selected, not working. #22

senyan opened this issue Nov 18, 2014 · 3 comments

Comments

@senyan
Copy link

senyan commented Nov 18, 2014

grammar AgencyCompany

  rule expression
    find_agency / find_company
  end

  rule find_agency
    agency space that space concrete_company space work_with
  end

  rule find_company
    company space that concrete_agency space work_with
  end

  rule work_with
    ("has" / "have") space ("partnered" / "partner" / "worked" / "work") space "with"
  end

  rule that
    "that" / "which"
  end

  rule company
    "companies" / "vendors" / "company" / "vendor"
  end

  rule agency
    "agency" / "agencies"
  end

  rule my_company
    "my company"
  end

  rule concrete_company
    entity_name
  end

  rule concrete_agency
    entity_name
  end

  rule entity_name
    word space entity_name
  end

  rule word
    [a-zA-Z]+
  end

  rule space
    [\s]+
  end

end
`` `
Not sure why this simple grammar is failing, if I parse a string start with "company", the ``failure_reason`` shows it is expecting ``agency``, but for a string start with "company" it is expecting "agency". 
@senyan
Copy link
Author

senyan commented Nov 18, 2014

This is more like a problem of the code rather than Treetop. I will post it in the mailing list for stack overflow.

@senyan senyan closed this as completed Nov 18, 2014
@cjheath
Copy link
Owner

cjheath commented Nov 18, 2014

Please don't post support questions as github issues. I don't track stack overflow frequently either. The documented support forum is the google group - please always ask there first.

@senyan
Copy link
Author

senyan commented Nov 19, 2014

Sorry about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants