-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpjba.ebnf
48 lines (47 loc) · 1.82 KB
/
pjba.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
(*
=: symbol definition
|: choice (eg. x or y)
[]: optional
(): group (usually used with |)
{}: 0 or more
<>: 1 or more
'value': constant (terminal string)
"value": constant (terminal string)
(* comment *)
? All UTF-8 characters ?: description of a terminal string (to avoid complex or over-describing grammar)
-: exception (string = '"' {character - '"'} '"')
*)
pjba = <class>
class = classStartDir classModifiers className methods classEndDir
methods = {method}
method = methodStartDir methodModifiers methodName
methodSignature methodContent methodEndDir
className = identifier {identifierSeparator identifier}
methodName = identifier
methodSignature = parametersStart parametersDescriptor parametersEnd returnDescriptor
parametersDescriptor = descriptor {descriptor}
returnDescriptor = descriptor | 'V'
methodContent = {instruction}
instruction = mnemonic {arg}
identifier = asciiJavaLetter {asciiJavaLetter | digit}
mnemonic = ? known mnemonic ?
arg = ? authorized argument for mnemonic ?
classModifiers = {classModifier}
methodModifiers = {methodModifier}
classStartIdentifier = '.class'
classEndIdentifier = '.endclass'
methodStartIdentifier = '.method'
methodEndIdentifier = '.endMethod'
classModifier = 'public' | 'final' | 'abstract' | 'interface' | 'super'
methodsModifier = 'public' | 'protected' | 'private' | 'static' | 'final'
| 'strictfp' | 'synchronized' | 'abstract' | 'native'
descriptor = 'B' | 'C' | 'D' | 'F' | 'I' | 'J' | 'S' | 'Z' |
'['descriptor | 'L' className ';'
parametersStart = '('
parametersEnd = ')'
identifierSeparator = '/'
comment = singlelineComment | multilineComment
singlelineComment = ('@' | '#') ? All characters but LF and EOF ? (LF | EOF)
multilineComment = '/*' ? All UTF-8 characters but '*/'? '*/'
asciiJavaLetter = ? a-z | A-Z | '_' | '$' ?
digit = ? 0-9 ?