//! Java Parser item = _{ SOI ~ line* ~ EOI } line = _{ regexp | string | other } other = ${ !(string) ~ ANY } WHITESPACE = { " " | "\t" | NEWLINE } /// Comment line_comment = _{ "//" ~ (!(NEWLINE) ~ ANY)* } block_comment = _{ "/*" ~ (!("*/") ~ ANY)* ~ "*/" } COMMENT = ${ line_comment | block_comment } /// String string = ${ inner_string } inner_string = _{ ("\"\"\"" ~ (!("\"\"\"") ~ ANY)* ~ "\"\"\"") | ("\"" ~ (!(NEWLINE | "\"") ~ ANY)* ~ "\"") } /// Regexp regexp = ${ ("Pattern." ~ (ASCII_ALPHA)+ ~ "(" ~ " "* ~ inner_string ~ (!")" ~ ANY)* ~ ")") }