Skip to content

Commit

Permalink
Update snippet code (JetBrains#45)
Browse files Browse the repository at this point in the history
* Update snippet code

This makes reference to a future code, requires `com.simpleplugin.psi.impl.SimplePsiImplUtil` which is not implemented until step 6.

* Update grammar_and_parser.md
  • Loading branch information
fmodesto authored and ignatov committed Aug 19, 2017
1 parent 1db6880 commit 66a8f42
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tutorials/custom_language_support/grammar_and_parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,26 @@ title: 3. Grammar and Parser
Define a grammar for the properties language with */com/simpleplugin/Simple.bnf* file.

```java
{% include /code_samples/simple_language_plugin/src/com/simpleplugin/Simple.bnf %}
{
parserClass="com.simpleplugin.parser.SimpleParser"

extends="com.intellij.extapi.psi.ASTWrapperPsiElement"

psiClassPrefix="Simple"
psiImplClassSuffix="Impl"
psiPackage="com.simpleplugin.psi"
psiImplPackage="com.simpleplugin.psi.impl"

elementTypeHolderClass="com.simpleplugin.psi.SimpleTypes"
elementTypeClass="com.simpleplugin.psi.SimpleElementType"
tokenTypeClass="com.simpleplugin.psi.SimpleTokenType"
}

simpleFile ::= item_*

private item_ ::= (property|COMMENT|CRLF)

property ::= (KEY? SEPARATOR VALUE?) | KEY
```

As you see a properties file can contain properties, comments and line breaks.
Expand Down

0 comments on commit 66a8f42

Please sign in to comment.