1 using System.Net.Http;
2 using HttpTokens;
3
4 parser HttpMediaTypeParser
5 {
6 uselexer HttpLexer;
7 main;
8
9 using Http.token;
10 using Http.parameter;
11 using Http.lws;
12
13 MediaType(MimeType* mimeType, var Pair<string, string> param)
14 ::= (Type:t SLASH Subtype:st){ mimeType->SetValue(t, st); } (lws:lws1? SEMICOLON lws:lws2? parameter:p{ param = p; mimeType->SetParameter(param.first, param.second); })*
15 ;
16
17 Type : string
18 ::= token:t{ return t; }
19 ;
20
21 Subtype : string
22 ::= token:t{ return t; }
23 ;
24 }