set bnf language for bnf code snippets

This commit is contained in:
Karol Lewandowski 2022-07-25 13:41:14 +02:00
parent 7f46681428
commit b18ad63fe0
5 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ Now add the `SimplePsiImplUtil.getPresentation()` to the `property` methods defi
Don't forget to regenerate the parser after updating the file!
Right-click on the <path>Simple.bnf</path> file and select <control>Generate Parser Code</control>.
```java
```bnf
property ::= (KEY? SEPARATOR VALUE?) | KEY {
mixin="org.intellij.sdk.language.psi.impl.SimpleNamedElementImpl"
implements="org.intellij.sdk.language.psi.SimpleNamedElement"

View File

@ -31,7 +31,7 @@ Create the `SimpleElementType` in the `org.intellij.sdk.language.psi` package by
Define a grammar for the Simple Language in the <path>com/intellij/sdk/language/Simple.bnf</path> file.
```properties
```bnf
{
parserClass="org.intellij.sdk.language.parser.SimpleParser"

View File

@ -44,7 +44,7 @@ Now the utility class is added to the grammar file via the `psiImplUtilClass` at
Add methods for a particular rule to specify which one should be used for PSI classes.
Compare the last line of the grammar below to the [previous definition](grammar_and_parser.md#define-the-grammar).
```java
```bnf
{
parserClass="org.intellij.sdk.language.parser.SimpleParser"

View File

@ -96,7 +96,7 @@ Now make corresponding changes to the <path>Simple.bnf</path> grammar file by re
Don't forget to regenerate the parser after updating the file!
Right-click on the <path>Simple.bnf</path> file and select **Generate Parser Code**.
```java
```bnf
property ::= (KEY? SEPARATOR VALUE?) | KEY {
mixin="org.intellij.sdk.language.psi.impl.SimpleNamedElementImpl"
implements="org.intellij.sdk.language.psi.SimpleNamedElement"

View File

@ -16,7 +16,7 @@ If the lines below are not present in <path>Simple.bnf</path>, replace the exist
Don't forget to regenerate the parser after updating the file!
Right-click on the <path>Simple.bnf</path> file and select <control>Generate Parser Code</control>.
```java
```bnf
property ::= (KEY? SEPARATOR VALUE?) | KEY {
pin=3
recoverWhile="recover_property"