{"action":"opened","issue":{"url":"https://api.github.com/repos/antlr/antlr4/issues/2300","repository_url":"https://api.github.com/repos/antlr/antlr4","labels_url":"https://api.github.com/repos/antlr/antlr4/issues/2300/labels{/name}","comments_url":"https://api.github.com/repos/antlr/antlr4/issues/2300/comments","events_url":"https://api.github.com/repos/antlr/antlr4/issues/2300/events","html_url":"https://github.com/antlr/antlr4/issues/2300","id":328063191,"node_id":"MDU6SXNzdWUzMjgwNjMxOTE=","number":2300,"title":"Unable to tokenize the right parenthesis and comments using python 3.6.5","user":{"login":"foxpangxie","id":39793713,"node_id":"MDQ6VXNlcjM5NzkzNzEz","avatar_url":"https://avatars3.githubusercontent.com/u/39793713?v=4","gravatar_id":"","url":"https://api.github.com/users/foxpangxie","html_url":"https://github.com/foxpangxie","followers_url":"https://api.github.com/users/foxpangxie/followers","following_url":"https://api.github.com/users/foxpangxie/following{/other_user}","gists_url":"https://api.github.com/users/foxpangxie/gists{/gist_id}","starred_url":"https://api.github.com/users/foxpangxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foxpangxie/subscriptions","organizations_url":"https://api.github.com/users/foxpangxie/orgs","repos_url":"https://api.github.com/users/foxpangxie/repos","events_url":"https://api.github.com/users/foxpangxie/events{/privacy}","received_events_url":"https://api.github.com/users/foxpangxie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-31T09:31:07Z","updated_at":"2018-05-31T09:31:07Z","closed_at":null,"author_association":"NONE","body":"I download the JavaLexer.g4 from GitHub. I try to use the generated JavaLexer.py to handle the java file like following:\r\n\r\n```\r\n    lexer = JavadocLexer(inputFile)\r\n\r\n    it = iter(lexer.getAllTokens())\r\n    for tk in it:\r\n        print(\"line: %s ; colum: %s ; type: %s ; (%s, %s)\" %(tk.line, tk.column, tk.type, tk.start, tk.stop))\r\n        next(it)\r\n```\r\nand the sample java file used to analysis is like following:\r\n\r\npackage application;\r\n\r\nimport java.util.Iterator;\r\n\r\n```\r\n/**\r\n * level one class comment.\r\n */\r\npublic class SampleJava extends ISampleJava\r\n{\r\n\t// level one line comment\r\n\tint a = 0;\r\n\t\r\n\t/**\r\n\t* level two class comment.\r\n\t*/\r\n\tpublic void first() \r\n\t{\r\n\t\t// level two line comment.\r\n\t}\r\n}\r\n```\r\nEvery right parenthesis and level two comment is not tokenized, seems to be skipped.\r\nUsing \"antlr-4.7.1-complete\" to generate lexer python code. And antlr4-python3-runtime.\r\n"}}
{"actor":{"display_login":"foxpangxie"}}