SHARE
TWEET

Untitled

a guest Feb 28th, 2019 151 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.   parserClass="syntaxHighlighting.TAC_parser"
  3.   parserUtilClass="syntaxHighlighting.TAC_parserParserUtil"
  4.   extends="com.intellij.extapi.psi.ASTWrapperPsiElement"
  5.  
  6.   psiClassPrefix="TAC"
  7.   psiImplClassSuffix="Impl"
  8.   psiPackage="syntaxHighlighting"
  9.   psiImplPackage="syntaxHighlighting.psi.impl"
  10.  
  11.   elementTypeHolderClass="syntaxHighlighting.TAC_elementTypeHolder"
  12.   elementTypeClass="syntaxHighlighting.psi.TAC_elementType"
  13.   tokenTypeClass="syntaxHighlighting.psi.TAC_tokenType"
  14.  
  15.   psiImplUtilClass="syntaxHighlighting.psi.impl.TACPsiImplUtil"
  16.  
  17.   tokens=[
  18.     //CRLF='regexp:\R'
  19.  
  20.     //NUMBER ='regexp:(-)?[0-9]+'
  21.  
  22.  
  23.     //JAVA="regexp:(([A-Za-z])*\.)+([A-Za-z])*(\{(.)*\})?"
  24.     //KEYWORDS="regexp:goto|if|else|catch|caught|return"
  25.     // TYPES
  26.     //JAVATYPE="regexp:(([A-Za-z])*\.)+[A-Z-a-z]*"
  27.     LEVEL="regexp:lv"
  28.  
  29.         WHITE_SPACE='regexp:\s+'
  30.         COMMENT='regexp://.*'
  31.         STRING="regexp:('([^'\\]|\\.)*'|\"([^\"\\]|\\.)*\")"
  32.  
  33.    LBRACKET="regexp:\(|\{|\[|<"
  34.    RBRACKET="regexp:\)|\}|\]|>"
  35.    BLOCK_COMMENT="regexp:/\*[^\*/]*\*/"
  36.    COLON=":"
  37.    EQ="="
  38.    SEMI_COLON=";"
  39.     AT="@"
  40.     NL="\n"
  41.     DOT="."
  42.     NUMBER ='regexp:(-)?\d+(\.\d*)?'
  43.     MODIFIER="regexp:public|private|protected|abstract|static|final|default"
  44.     PRIMITIVE_TYPE="regexp:void|boolean|byte|char|short|int|long|float|double"
  45.     STRINGVAR = "regexp:[a-zA-Z$_][a-zA-Z0-9$_]*"
  46.  
  47.     ]
  48.  
  49. }
  50.  
  51. // TODO: ClassHead Method*
  52. tacFile ::= Method*
  53.  
  54. private Method ::= MethodHead MethodBody*
  55.  
  56. private MethodHead ::= JType LBRACKET modifier* Type MethodName RBRACKET
  57.  
  58. private Type ::= (PRIMITIVE_TYPE | JType)('[]')*
  59. JType ::= (STRINGVAR'.')*STRINGVAR  {mixin="syntaxHighlighting.psi.impl.TAC_namedElementImpl"
  60.                                        implements="syntaxHighlighting.TAC_namedElement"
  61.                                        methods=[getKey getName setName getNameIdentifier getPresentation]}
  62.  
  63. private modifier ::= MODIFIER
  64.  
  65. MethodName ::=  ('<init>'|'<clinit>'|DefMethodName) params
  66. private DefMethodName ::= STRINGVAR
  67. private params ::= ('('(Type ','?)*')')?
  68.  
  69.  
  70.  
  71. private MethodBody ::= NUMBER COLON (returnInstr|otherInstr|assignmentInstr|methodCallInstr)
  72.  
  73. private otherInstr ::= JType EQ reg
  74. private assignmentInstr ::= reg EQ (NUMBER ('f'|'d')?|STRING|reg)
  75. private methodCallInstr ::= reg DOT ('<init>'|'<clinit>'|STRINGVAR) ((LBRACKET reg? RBRACKET) | (EQ reg))
  76. private returnInstr ::= "return" ['{' STRINGVAR '}']
  77.  
  78.  
  79. private reg ::= ["new"] ['{'] (JType|STRINGVAR) ['}']
  80.  
  81. property ::= (KEY? SEPARATOR VALUE?) | KEY {mixin="syntaxHighlighting.psi.impl.TAC_namedElementImpl"
  82.   implements="syntaxHighlighting.TAC_namedElement" methods=[getKey getValue getName setName getNameIdentifier getPresentation]}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top