help me with Grammar Kit
I wrote a grammar like below:
{
tokens=[
DEL_COMMAND="regexp:[dD][eE][lL]"
SET_COMMAND="regexp:[sS][eE][tT]"
DUMP_COMMAND="regexp:[dD][uU][mM][pP]"
EXISTS_COMMAND="regexp:[eE][xX][iI][sS][tT][sS]"
PLUS="+"
MINUS="-"
COMMENT="regexp://.*"
NUMBER="regexp:-?\d+"
FLOAT="regexp:-?\d+(\.\d*)?"
STRING="regexp:[^ \r\n\t]+|\"[^\"]*\""
EOL="regexp:[\n|\r|\r\n]"
WS="regexp:[ \t\r\n]+"
]
}
root ::= command_or_comment *
command_or_comment ::= (command COMMENT? | COMMENT) EOL?
command ::= del|set
del ::= DEL_COMMAND key
set ::= SET_COMMAND key STRING
key ::= STRING
The grammar works well with preview of Grammar-Kit:
After I generate the Lexer、Parser and register the custom language with IntelliJ, I get a error message when I type the same thing (set a b). Following is the full detail of the error message:
[ 22246] ERROR - pplication.impl.LaterInvocator - null
java.lang.NullPointerException
at com.intellij.pom.tree.events.impl.TreeChangeImpl.b(TreeChangeImpl.java:400)
at com.intellij.pom.tree.events.impl.TreeChangeImpl.c(TreeChangeImpl.java:391)
at com.intellij.pom.tree.events.impl.TreeChangeImpl.a(TreeChangeImpl.java:122)
at com.intellij.pom.tree.events.impl.TreeChangeImpl.addChange(TreeChangeImpl.java:116)
at com.intellij.pom.wrappers.PsiEventWrapperAspect.a(PsiEventWrapperAspect.java:74)
at com.intellij.pom.wrappers.PsiEventWrapperAspect.update(PsiEventWrapperAspect.java:50)
at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:180)
at com.intellij.psi.impl.DocumentCommitProcessor$2.run(DocumentCommitProcessor.java:224)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$8.compute(CodeStyleManagerImpl.java:682)
at com.intellij.psi.impl.source.PostprocessReformattingAspect.disablePostprocessFormattingInside(PostprocessReformattingAspect.java:124)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl$10.compute(CodeStyleManagerImpl.java:717)
at com.intellij.formatting.FormatterImpl.runWithFormattingDisabled(FormatterImpl.java:924)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:713)
at com.intellij.psi.impl.source.codeStyle.CodeStyleManagerImpl.performActionWithFormatterDisabled(CodeStyleManagerImpl.java:679)
at com.intellij.psi.impl.DocumentCommitProcessor.doActualPsiChange(DocumentCommitProcessor.java:209)
at com.intellij.psi.impl.DocumentCommitProcessor$1.process(DocumentCommitProcessor.java:145)
at com.intellij.psi.impl.DocumentCommitProcessor$1.process(DocumentCommitProcessor.java:135)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommitInWriteAction(PsiDocumentManagerBase.java:333)
at com.intellij.psi.impl.PsiDocumentManagerImpl.finishCommitInWriteAction(PsiDocumentManagerImpl.java:143)
at com.intellij.psi.impl.PsiDocumentManagerBase$3.run(PsiDocumentManagerBase.java:298)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:1010)
at com.intellij.psi.impl.PsiDocumentManagerBase.finishCommit(PsiDocumentManagerBase.java:295)
at com.intellij.psi.impl.DocumentCommitThread$5.run(DocumentCommitThread.java:528)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:337)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[ 22247] ERROR - pplication.impl.LaterInvocator - IntelliJ IDEA 15.0.3 Build #IU-143.1821.5
[ 22247] ERROR - pplication.impl.LaterInvocator - JDK: 1.6.0_65
[ 22247] ERROR - pplication.impl.LaterInvocator - VM: Java HotSpot(TM) 64-Bit Server VM
[ 22247] ERROR - pplication.impl.LaterInvocator - Vendor: Apple Inc.
[ 22247] ERROR - pplication.impl.LaterInvocator - OS: Mac OS X
[ 22247] ERROR - pplication.impl.LaterInvocator - Last Action: EditorEnter
[ 22588] ERROR - til.concurrency.QueueProcessor - {PERFORM_ALWAYS=[com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler$2@fc36c2e]}
java.lang.AssertionError: {PERFORM_ALWAYS=[com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler$2@fc36c2e]}
at com.intellij.psi.impl.PsiDocumentManagerBase.cancelAndRunWhenAllCommitted(PsiDocumentManagerBase.java:262)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$10.run(DaemonCodeAnalyzerImpl.java:823)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:337)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[ 22589] ERROR - til.concurrency.QueueProcessor - IntelliJ IDEA 15.0.3 Build #IU-143.1821.5
[ 22589] ERROR - til.concurrency.QueueProcessor - JDK: 1.6.0_65
[ 22589] ERROR - til.concurrency.QueueProcessor - VM: Java HotSpot(TM) 64-Bit Server VM
[ 22589] ERROR - til.concurrency.QueueProcessor - Vendor: Apple Inc.
[ 22589] ERROR - til.concurrency.QueueProcessor - OS: Mac OS X
[ 22589] ERROR - til.concurrency.QueueProcessor - Last Action: EditorEnter
[ 24235] ERROR - til.concurrency.QueueProcessor - {PERFORM_ALWAYS=[com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler$2@fc36c2e]}
java.lang.AssertionError: {PERFORM_ALWAYS=[com.intellij.codeInsight.editorActions.CompletionAutoPopupHandler$2@fc36c2e]}
at com.intellij.psi.impl.PsiDocumentManagerBase.cancelAndRunWhenAllCommitted(PsiDocumentManagerBase.java:262)
at com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl$10.run(DaemonCodeAnalyzerImpl.java:823)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.a(LaterInvocator.java:337)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:321)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:866)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:654)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:381)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
[ 24236] ERROR - til.concurrency.QueueProcessor - IntelliJ IDEA 15.0.3 Build #IU-143.1821.5
[ 24236] ERROR - til.concurrency.QueueProcessor - JDK: 1.6.0_65
[ 24236] ERROR - til.concurrency.QueueProcessor - VM: Java HotSpot(TM) 64-Bit Server VM
[ 24236] ERROR - til.concurrency.QueueProcessor - Vendor: Apple Inc.
[ 24236] ERROR - til.concurrency.QueueProcessor - OS: Mac OS X
[ 24236] ERROR - til.concurrency.QueueProcessor - Last Action: EditorEnter
Can anyone help me please, thanks.
Please sign in to leave a comment.
fixed by myself already