37 lines
567 B
Plaintext
37 lines
567 B
Plaintext
@top Program { expression* }
|
|
|
|
@skip {} {
|
|
BlockComment { "/*" (blockCommentContent | blockCommentNewline)* blockCommentEnd }
|
|
}
|
|
|
|
@skip { space | LineComment | BlockComment }
|
|
|
|
@local tokens {
|
|
blockCommentEnd { "*/" }
|
|
blockCommentNewline { "\n" }
|
|
@else blockCommentContent
|
|
}
|
|
|
|
expression {
|
|
Identifier |
|
|
String |
|
|
Boolean |
|
|
Application { "(" expression* ")" }
|
|
}
|
|
|
|
@tokens {
|
|
Identifier { $[a-zA-Z_\-0-9]+ }
|
|
|
|
String { '"' (!["\\] | "\\" _)* '"' }
|
|
|
|
Boolean { "#t" | "#f" }
|
|
|
|
LineComment { "//" ![\n]* }
|
|
|
|
space { $[ \t\n\r]+ }
|
|
|
|
"(" ")"
|
|
}
|
|
|
|
@detectDelim
|