File tree Expand file tree Collapse file tree
src/org/rascalmpl/library/lang/paths Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ @synopsis{This encodes the mail address part of RFC822}
2+ @pitfalls{
3+ This was taken over literally from RFC822 but not tested.
4+ }
5+ module lang::paths::MailAddress
6+
7+ lexical Address
8+ = adressee: Mailbox
9+ | namedList: Group
10+ ;
11+
12+ lexical Group = Phrase ":" {Mailbox ","}+ ";";
13+
14+ lexical Mailbox
15+ = simpleAddress: AddrSpec
16+ | nameAndAddrSpec: Phrase RouteAddr
17+ ;
18+
19+ lexical RouteAddr = "\<" Route? AddrSpec "\>";
20+
21+ lexical Route = {Domain "@"}+ ":"; // hard to interpret original: 1#("@" domain) ":"
22+
23+ lexical AddrSpec = globalAddress: LocalPart "@" Domain;
24+
25+ lexical LocalPart = uninterpretedCasePreserved: {Word "."}+ ;
26+
27+ lexical Domain = {SubDomain "."}+;
28+
29+ lexical SubDomain = DomainRef | DomainLiteral;
30+
31+ lexical DomainLiteral = "[" (Dtext | QuotedPair)* "]";
32+
33+ lexical Dtext = (![\\\]\[\n\r\ ] + [\ ])+;
34+
35+ lexical DomainRef = Atom;
36+
37+ lexical Phrase = Word+;
38+
39+ lexical Atom = ![] - [()\<\>@,;:|\".\[\]] - [\a00-a20] - [\ ];
40+
41+ lexical Specials = [()\<\>@,;:|\".\[\]];
42+
43+ lexical Controls = [\a00-\a20];
44+
45+ lexical Word = Atom | QuotedString;
46+
47+ lexical QuotedString = "\"" (Qtext | QuotedPair)* "\"";
48+
49+ lexical Qtext = (![\\\"\n\r] + [\ ])+;
50+
51+ lexical QuotedPair = "\\" CHAR;
52+
53+ lexical CHAR = [\a00-\a7F]; // All of ASCII
Original file line number Diff line number Diff line change 11@synopsis {Implements RFC1738 for URL syntax and maps them to `loc` values.}
2+ @pitfalls {
3+ This was taken over literall from RFC1738 but not tested.
4+ }
25module lang ::paths ::URL
36
7+ extend lang ::paths ::MailAddress ;
48lexical URL
59 = http: "http://" HostPort ( "/" Hpath ( "?" Search)?)?
610 | ftp: "ftp://" Login ("/" Fpath (";type=" FtpType)?)?
You can’t perform that action at this time.
0 commit comments