From 66a8f42fd29df80944209e387ea3f4461058fa2d Mon Sep 17 00:00:00 2001 From: fmodesto Date: Sat, 19 Aug 2017 12:33:19 +0200 Subject: [PATCH] Update snippet code (#45) * 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 --- .../grammar_and_parser.md | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tutorials/custom_language_support/grammar_and_parser.md b/tutorials/custom_language_support/grammar_and_parser.md index c4eeefa5db1..0e528845f30 100644 --- a/tutorials/custom_language_support/grammar_and_parser.md +++ b/tutorials/custom_language_support/grammar_and_parser.md @@ -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.