mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 10:17:50 +08:00
Fixes #IJSDK-133, we can't reference the complete grammar file until later in the tutorial
This commit is contained in:
parent
b8fb86ac63
commit
784b8cd31e
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user