generated from JetBrains/intellij-platform-plugin-template
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
parserClass="DevtiParser" | ||
extends="com.intellij.extapi.psi.ASTWrapperPsiElement" | ||
psiClassPrefix="DevtiStory" | ||
psiImplClassSuffix="Impl" | ||
psiPackage="com.example.devtistory.psi" | ||
psiImplPackage="com.example.devtistory.psi.impl" | ||
} | ||
|
||
root ::= devtiUrl | ||
|
||
devtiUrl ::= 'devti://' storyPath | ||
|
||
storyPath ::= 'story' '/' storyId '/' acValues? | ||
|
||
storyId ::= integer | ||
|
||
// Matches a comma-separated list of AC values enclosed in curly braces | ||
acValues ::= '{' acValue (',' acValue)* '}' | ||
|
||
// Define the rules for integer and ac_value | ||
acValue ::= ('AC' INTEGER_LITERAL) {pin=2} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package ; | ||
|
||
import com.intellij.lexer.FlexLexer; | ||
import com.intellij.psi.tree.IElementType; | ||
|
||
import static com.intellij.psi.TokenType.BAD_CHARACTER; | ||
import static com.intellij.psi.TokenType.WHITE_SPACE; | ||
import static generated.GeneratedTypes.*; | ||
|
||
%% | ||
|
||
%{ | ||
public _DevtiLexer() { | ||
this((java.io.Reader)null); | ||
} | ||
%} | ||
|
||
%public | ||
%class _DevtiLexer | ||
%implements FlexLexer | ||
%function advance | ||
%type IElementType | ||
%unicode | ||
|
||
EOL=\R | ||
WHITE_SPACE=\s+ | ||
|
||
|
||
%% | ||
<YYINITIAL> { | ||
{WHITE_SPACE} { return WHITE_SPACE; } | ||
|
||
"integer" { return INTEGER; } | ||
"INTEGER_LITERAL" { return INTEGER_LITERAL; } | ||
|
||
|
||
} | ||
|
||
[^] { return BAD_CHARACTER; } |