{"action":"created","issue":{"url":"https://api.github.com/repos/antlr/antlr4/issues/947","labels_url":"https://api.github.com/repos/antlr/antlr4/issues/947/labels{/name}","comments_url":"https://api.github.com/repos/antlr/antlr4/issues/947/comments","events_url":"https://api.github.com/repos/antlr/antlr4/issues/947/events","html_url":"https://github.com/antlr/antlr4/issues/947","id":92596328,"number":947,"title":"ANTLR4 : no viable alternative at input user","user":{"login":"BruceXu1991","id":8579142,"avatar_url":"https://avatars.githubusercontent.com/u/8579142?v=3","gravatar_id":"","url":"https://api.github.com/users/BruceXu1991","html_url":"https://github.com/BruceXu1991","followers_url":"https://api.github.com/users/BruceXu1991/followers","following_url":"https://api.github.com/users/BruceXu1991/following{/other_user}","gists_url":"https://api.github.com/users/BruceXu1991/gists{/gist_id}","starred_url":"https://api.github.com/users/BruceXu1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BruceXu1991/subscriptions","organizations_url":"https://api.github.com/users/BruceXu1991/orgs","repos_url":"https://api.github.com/users/BruceXu1991/repos","events_url":"https://api.github.com/users/BruceXu1991/events{/privacy}","received_events_url":"https://api.github.com/users/BruceXu1991/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-02T09:44:35Z","updated_at":"2015-07-06T08:21:34Z","closed_at":null,"body":"this is my grammar below:\r\nselect_statement:\r\n        select_expression (  UNION (ALL | DISTINCT)?  select_expression )*\r\n;\r\n\r\nselect_expression:\r\n\tSELECT\r\n\t( ALL | DISTINCT  )?\r\n\tselect_list\r\n\t(\r\n\t\tFROM table_references\r\n\t\t( where_clause )?\r\n\t\t( groupby_clause )?\r\n\t\t( having_clause )?\r\n\t) ?\r\n\t( orderby_clause )?\r\n\t( limit_clause )?\r\n;\r\n\r\ntable_references:\r\n        table_reference ( COMMA table_reference )*\r\n;\r\ntable_reference:\r\n\ttable_factor1 | table_atom\r\n;\r\ntable_factor1:\r\n\ttable_factor2 (  (CROSS)? JOIN table_atom (join_condition)?  )?\r\n;\r\ntable_factor2:\r\n\ttable_factor3 (  (LEFT|RIGHT|FULL) (OUTER)? JOIN table_factor3 join_condition  )?\r\n;\r\ntable_factor3:\r\n\ttable_atom (  ( (LEFT|RIGHT|FULL) (OUTER)? )? JOIN table_atom )?\r\n;\r\ntable_atom:\r\n\t  ( table_spec (alias)?  )\r\n\t| ( subquery alias )\r\n\t| ( LPAREN table_references RPAREN )\r\n\t|  ID\r\n;\r\nID:\r\n\t( 'A'..'Z' | 'a'..'z' | '_' | '$') ( 'A'..'Z' | 'a'..'z' | '_' | '$' | '0'..'9' )*\r\n;\r\nwhen the input : select * from user  OR  select * from use ;\r\nthe error is \" ANTLR4 : no viable alternative at input (use |  user)\"\r\nand when I input other : select * from us OR \r\n                                      select * from usera OR \r\n                                      select * from abc..               It  turn out right.\r\n\r\nSo  why the  \" use' \"and \" user \" can't be recognized ? "},"comment":{"url":"https://api.github.com/repos/antlr/antlr4/issues/comments/118771216","html_url":"https://github.com/antlr/antlr4/issues/947#issuecomment-118771216","issue_url":"https://api.github.com/repos/antlr/antlr4/issues/947","id":118771216,"user":{"login":"jimidle","id":1309104,"avatar_url":"https://avatars.githubusercontent.com/u/1309104?v=3","gravatar_id":"","url":"https://api.github.com/users/jimidle","html_url":"https://github.com/jimidle","followers_url":"https://api.github.com/users/jimidle/followers","following_url":"https://api.github.com/users/jimidle/following{/other_user}","gists_url":"https://api.github.com/users/jimidle/gists{/gist_id}","starred_url":"https://api.github.com/users/jimidle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jimidle/subscriptions","organizations_url":"https://api.github.com/users/jimidle/orgs","repos_url":"https://api.github.com/users/jimidle/repos","events_url":"https://api.github.com/users/jimidle/events{/privacy}","received_events_url":"https://api.github.com/users/jimidle/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T08:21:34Z","updated_at":"2015-07-06T08:21:34Z","body":"Make sure that it is listed in your lexer before rules like ID\n\n\n\n\n\n\nOn Mon, Jul 6, 2015 at 1:18 AM -0700, \"Bruce Xu\" <notifications@github.com> wrote:\n\n\n\n\n\n\n\n\n\n\n\n\nwhat should  i do inorder to recognize the 'use' and 'user'.\n\n\n\n—\nReply to this email directly or view it on GitHub."}}