mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
set bnf language for bnf code snippets
This commit is contained in:
parent
7f46681428
commit
b18ad63fe0
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user