Files
yaak-mountain-loop/src-web/components/Editor/url/url.grammar
2023-02-28 11:26:26 -08:00

31 lines
456 B
Plaintext

@top url { Protocol Host Path Query }
Protocol {
ProtocolName Slashy
}
Path {
(Slash PathSegment)*
}
Query {
Question (QueryPair)*
}
QueryPair {
Amp? QueryName Equal QueryValue
}
@tokens {
ProtocolName { "http" | "https" }
Host { $[a-zA-Z0-9-_.]+ }
QueryName { $[a-zA-Z0-9-_.]+ }
QueryValue { $[a-zA-Z0-9-_.]+ }
PathSegment { $[a-zA-Z0-9-_.]+ }
Slashy { "://" }
Slash { "/" }
Question { "?" }
Equal { "=" }
Amp { "&" }
}