]>
git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_codesigning/lib/RequirementLexer.cpp
1 /* $ANTLR 2.7.7 (20121221): "requirements.grammar" -> "RequirementLexer.cpp"$ */
2 #include "RequirementLexer.hpp"
3 #include <antlr/CharBuffer.hpp>
4 #include <antlr/TokenStreamException.hpp>
5 #include <antlr/TokenStreamIOException.hpp>
6 #include <antlr/TokenStreamRecognitionException.hpp>
7 #include <antlr/CharStreamException.hpp>
8 #include <antlr/CharStreamIOException.hpp>
9 #include <antlr/NoViableAltForCharException.hpp>
12 #include "requirement.h"
14 #include "csutilities.h"
15 #include <security_utilities/cfutilities.h>
16 #include <security_utilities/hashing.h>
17 #include <security_cdsa_utilities/cssmdata.h> // OID coding
18 using namespace CodeSigning
;
19 typedef Requirement::Maker Maker
;
21 ANTLR_BEGIN_NAMESPACE(Security_CodeSigning
)
22 RequirementLexer::RequirementLexer(std::istream
& in
)
23 : antlr::CharScanner(new antlr::CharBuffer(in
),true)
28 RequirementLexer::RequirementLexer(antlr::InputBuffer
& ib
)
29 : antlr::CharScanner(ib
,true)
34 RequirementLexer::RequirementLexer(const antlr::LexerSharedInputState
& state
)
35 : antlr::CharScanner(state
,true)
40 void RequirementLexer::initLiterals()
42 literals
["certificate"] = 25;
43 literals
["always"] = 15;
45 literals
["guest"] = 5;
46 literals
["cdhash"] = 20;
47 literals
["entitlement"] = 29;
48 literals
["library"] = 8;
49 literals
["never"] = 17;
50 literals
["cert"] = 26;
51 literals
["plugin"] = 9;
53 literals
["leaf"] = 42;
54 literals
["info"] = 28;
55 literals
["designated"] = 7;
56 literals
["apple"] = 23;
57 literals
["trusted"] = 27;
58 literals
["true"] = 16;
60 literals
["root"] = 43;
61 literals
["platform"] = 21;
62 literals
["anchor"] = 22;
63 literals
["false"] = 18;
64 literals
["generic"] = 24;
65 literals
["identifier"] = 19;
66 literals
["exists"] = 30;
69 antlr::RefToken
RequirementLexer::nextToken()
71 antlr::RefToken theRetToken
;
73 antlr::RefToken theRetToken
;
74 int _ttype
= antlr::Token::INVALID_TYPE
;
76 try { // for lexical and char stream error handling
78 case 0x22 /* '\"' */ :
81 theRetToken
=_returnToken
;
87 theRetToken
=_returnToken
;
93 theRetToken
=_returnToken
;
99 theRetToken
=_returnToken
;
102 case 0x5b /* '[' */ :
105 theRetToken
=_returnToken
;
108 case 0x5d /* ']' */ :
111 theRetToken
=_returnToken
;
114 case 0x2c /* ',' */ :
117 theRetToken
=_returnToken
;
120 case 0x7e /* '~' */ :
123 theRetToken
=_returnToken
;
126 case 0x2d /* '-' */ :
129 theRetToken
=_returnToken
;
132 case 0x21 /* '!' */ :
135 theRetToken
=_returnToken
;
138 case 0x2a /* '*' */ :
141 theRetToken
=_returnToken
;
144 case 0x9 /* '\t' */ :
145 case 0xa /* '\n' */ :
146 case 0x20 /* ' ' */ :
149 theRetToken
=_returnToken
;
152 case 0x23 /* '#' */ :
155 theRetToken
=_returnToken
;
159 if ((LA(1) == 0x2f /* '/' */ ) && (_tokenSet_0
.member(LA(2)))) {
161 theRetToken
=_returnToken
;
163 else if ((LA(1) == 0x48 /* 'H' */ ) && (LA(2) == 0x22 /* '\"' */ )) {
165 theRetToken
=_returnToken
;
167 else if ((LA(1) == 0x30 /* '0' */ ) && (LA(2) == 0x78 /* 'x' */ )) {
169 theRetToken
=_returnToken
;
171 else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3e /* '>' */ )) {
173 theRetToken
=_returnToken
;
175 else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) {
177 theRetToken
=_returnToken
;
179 else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) {
181 theRetToken
=_returnToken
;
183 else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3d /* '=' */ )) {
185 theRetToken
=_returnToken
;
187 else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2a /* '*' */ )) {
189 theRetToken
=_returnToken
;
191 else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2f /* '/' */ )) {
193 theRetToken
=_returnToken
;
195 else if ((_tokenSet_0
.member(LA(1))) && (true)) {
197 theRetToken
=_returnToken
;
199 else if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (true)) {
201 theRetToken
=_returnToken
;
203 else if ((LA(1) == 0x3c /* '<' */ ) && (true)) {
205 theRetToken
=_returnToken
;
207 else if ((LA(1) == 0x3e /* '>' */ ) && (true)) {
209 theRetToken
=_returnToken
;
211 else if ((LA(1) == 0x3d /* '=' */ ) && (true)) {
213 theRetToken
=_returnToken
;
219 _returnToken
= makeToken(antlr::Token::EOF_TYPE
);
221 else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
225 goto tryAgain
; // found SKIP token
227 _ttype
= _returnToken
->getType();
228 _returnToken
->setType(_ttype
);
231 catch (antlr::RecognitionException
& e
) {
232 throw antlr::TokenStreamRecognitionException(e
);
234 catch (antlr::CharStreamIOException
& csie
) {
235 throw antlr::TokenStreamIOException(csie
.io
);
237 catch (antlr::CharStreamException
& cse
) {
238 throw antlr::TokenStreamException(cse
.getMessage());
244 void RequirementLexer::mIDENT(bool _createToken
) {
245 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
247 std::string::size_type _saveIndex
;
251 case 0x41 /* 'A' */ :
252 case 0x42 /* 'B' */ :
253 case 0x43 /* 'C' */ :
254 case 0x44 /* 'D' */ :
255 case 0x45 /* 'E' */ :
256 case 0x46 /* 'F' */ :
257 case 0x47 /* 'G' */ :
258 case 0x48 /* 'H' */ :
259 case 0x49 /* 'I' */ :
260 case 0x4a /* 'J' */ :
261 case 0x4b /* 'K' */ :
262 case 0x4c /* 'L' */ :
263 case 0x4d /* 'M' */ :
264 case 0x4e /* 'N' */ :
265 case 0x4f /* 'O' */ :
266 case 0x50 /* 'P' */ :
267 case 0x51 /* 'Q' */ :
268 case 0x52 /* 'R' */ :
269 case 0x53 /* 'S' */ :
270 case 0x54 /* 'T' */ :
271 case 0x55 /* 'U' */ :
272 case 0x56 /* 'V' */ :
273 case 0x57 /* 'W' */ :
274 case 0x58 /* 'X' */ :
275 case 0x59 /* 'Y' */ :
276 case 0x5a /* 'Z' */ :
281 case 0x61 /* 'a' */ :
282 case 0x62 /* 'b' */ :
283 case 0x63 /* 'c' */ :
284 case 0x64 /* 'd' */ :
285 case 0x65 /* 'e' */ :
286 case 0x66 /* 'f' */ :
287 case 0x67 /* 'g' */ :
288 case 0x68 /* 'h' */ :
289 case 0x69 /* 'i' */ :
290 case 0x6a /* 'j' */ :
291 case 0x6b /* 'k' */ :
292 case 0x6c /* 'l' */ :
293 case 0x6d /* 'm' */ :
294 case 0x6e /* 'n' */ :
295 case 0x6f /* 'o' */ :
296 case 0x70 /* 'p' */ :
297 case 0x71 /* 'q' */ :
298 case 0x72 /* 'r' */ :
299 case 0x73 /* 's' */ :
300 case 0x74 /* 't' */ :
301 case 0x75 /* 'u' */ :
302 case 0x76 /* 'v' */ :
303 case 0x77 /* 'w' */ :
304 case 0x78 /* 'x' */ :
305 case 0x79 /* 'y' */ :
306 case 0x7a /* 'z' */ :
313 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
320 case 0x41 /* 'A' */ :
321 case 0x42 /* 'B' */ :
322 case 0x43 /* 'C' */ :
323 case 0x44 /* 'D' */ :
324 case 0x45 /* 'E' */ :
325 case 0x46 /* 'F' */ :
326 case 0x47 /* 'G' */ :
327 case 0x48 /* 'H' */ :
328 case 0x49 /* 'I' */ :
329 case 0x4a /* 'J' */ :
330 case 0x4b /* 'K' */ :
331 case 0x4c /* 'L' */ :
332 case 0x4d /* 'M' */ :
333 case 0x4e /* 'N' */ :
334 case 0x4f /* 'O' */ :
335 case 0x50 /* 'P' */ :
336 case 0x51 /* 'Q' */ :
337 case 0x52 /* 'R' */ :
338 case 0x53 /* 'S' */ :
339 case 0x54 /* 'T' */ :
340 case 0x55 /* 'U' */ :
341 case 0x56 /* 'V' */ :
342 case 0x57 /* 'W' */ :
343 case 0x58 /* 'X' */ :
344 case 0x59 /* 'Y' */ :
345 case 0x5a /* 'Z' */ :
350 case 0x61 /* 'a' */ :
351 case 0x62 /* 'b' */ :
352 case 0x63 /* 'c' */ :
353 case 0x64 /* 'd' */ :
354 case 0x65 /* 'e' */ :
355 case 0x66 /* 'f' */ :
356 case 0x67 /* 'g' */ :
357 case 0x68 /* 'h' */ :
358 case 0x69 /* 'i' */ :
359 case 0x6a /* 'j' */ :
360 case 0x6b /* 'k' */ :
361 case 0x6c /* 'l' */ :
362 case 0x6d /* 'm' */ :
363 case 0x6e /* 'n' */ :
364 case 0x6f /* 'o' */ :
365 case 0x70 /* 'p' */ :
366 case 0x71 /* 'q' */ :
367 case 0x72 /* 'r' */ :
368 case 0x73 /* 's' */ :
369 case 0x74 /* 't' */ :
370 case 0x75 /* 'u' */ :
371 case 0x76 /* 'v' */ :
372 case 0x77 /* 'w' */ :
373 case 0x78 /* 'x' */ :
374 case 0x79 /* 'y' */ :
375 case 0x7a /* 'z' */ :
380 case 0x30 /* '0' */ :
381 case 0x31 /* '1' */ :
382 case 0x32 /* '2' */ :
383 case 0x33 /* '3' */ :
384 case 0x34 /* '4' */ :
385 case 0x35 /* '5' */ :
386 case 0x36 /* '6' */ :
387 case 0x37 /* '7' */ :
388 case 0x38 /* '8' */ :
389 case 0x39 /* '9' */ :
402 _ttype
= testLiteralsTable(text
.substr(_begin
, text
.length()-_begin
),_ttype
);
403 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
404 _token
= makeToken(_ttype
);
405 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
407 _returnToken
= _token
;
411 void RequirementLexer::mDOTKEY(bool _createToken
) {
412 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
414 std::string::size_type _saveIndex
;
419 if ((LA(1) == 0x2e /* '.' */ )) {
423 case 0x41 /* 'A' */ :
424 case 0x42 /* 'B' */ :
425 case 0x43 /* 'C' */ :
426 case 0x44 /* 'D' */ :
427 case 0x45 /* 'E' */ :
428 case 0x46 /* 'F' */ :
429 case 0x47 /* 'G' */ :
430 case 0x48 /* 'H' */ :
431 case 0x49 /* 'I' */ :
432 case 0x4a /* 'J' */ :
433 case 0x4b /* 'K' */ :
434 case 0x4c /* 'L' */ :
435 case 0x4d /* 'M' */ :
436 case 0x4e /* 'N' */ :
437 case 0x4f /* 'O' */ :
438 case 0x50 /* 'P' */ :
439 case 0x51 /* 'Q' */ :
440 case 0x52 /* 'R' */ :
441 case 0x53 /* 'S' */ :
442 case 0x54 /* 'T' */ :
443 case 0x55 /* 'U' */ :
444 case 0x56 /* 'V' */ :
445 case 0x57 /* 'W' */ :
446 case 0x58 /* 'X' */ :
447 case 0x59 /* 'Y' */ :
448 case 0x5a /* 'Z' */ :
449 case 0x61 /* 'a' */ :
450 case 0x62 /* 'b' */ :
451 case 0x63 /* 'c' */ :
452 case 0x64 /* 'd' */ :
453 case 0x65 /* 'e' */ :
454 case 0x66 /* 'f' */ :
455 case 0x67 /* 'g' */ :
456 case 0x68 /* 'h' */ :
457 case 0x69 /* 'i' */ :
458 case 0x6a /* 'j' */ :
459 case 0x6b /* 'k' */ :
460 case 0x6c /* 'l' */ :
461 case 0x6d /* 'm' */ :
462 case 0x6e /* 'n' */ :
463 case 0x6f /* 'o' */ :
464 case 0x70 /* 'p' */ :
465 case 0x71 /* 'q' */ :
466 case 0x72 /* 'r' */ :
467 case 0x73 /* 's' */ :
468 case 0x74 /* 't' */ :
469 case 0x75 /* 'u' */ :
470 case 0x76 /* 'v' */ :
471 case 0x77 /* 'w' */ :
472 case 0x78 /* 'x' */ :
473 case 0x79 /* 'y' */ :
474 case 0x7a /* 'z' */ :
479 case 0x30 /* '0' */ :
480 case 0x31 /* '1' */ :
481 case 0x32 /* '2' */ :
482 case 0x33 /* '3' */ :
483 case 0x34 /* '4' */ :
484 case 0x35 /* '5' */ :
485 case 0x36 /* '6' */ :
486 case 0x37 /* '7' */ :
487 case 0x38 /* '8' */ :
488 case 0x39 /* '9' */ :
495 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
507 _ttype
= testLiteralsTable(_ttype
);
508 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
509 _token
= makeToken(_ttype
);
510 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
512 _returnToken
= _token
;
516 void RequirementLexer::mINTEGER(bool _createToken
) {
517 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
519 std::string::size_type _saveIndex
;
524 if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
528 if ( _cnt69
>=1 ) { goto _loop69
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
535 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
536 _token
= makeToken(_ttype
);
537 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
539 _returnToken
= _token
;
543 void RequirementLexer::mPATHNAME(bool _createToken
) {
544 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
546 std::string::size_type _saveIndex
;
553 if ((LA(1) == 0x2f /* '/' */ )) {
558 if ( _cnt54
>=1 ) { goto _loop54
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
565 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
566 _token
= makeToken(_ttype
);
567 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
569 _returnToken
= _token
;
573 void RequirementLexer::mHASHCONSTANT(bool _createToken
) {
574 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
575 _ttype
= HASHCONSTANT
;
576 std::string::size_type _saveIndex
;
578 _saveIndex
= text
.length();
579 match('H' /* charlit */ );
580 text
.erase(_saveIndex
);
581 _saveIndex
= text
.length();
582 match('\"' /* charlit */ );
583 text
.erase(_saveIndex
);
587 if ((_tokenSet_1
.member(LA(1)))) {
591 if ( _cnt57
>=1 ) { goto _loop57
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
598 _saveIndex
= text
.length();
599 match('\"' /* charlit */ );
600 text
.erase(_saveIndex
);
601 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
602 _token
= makeToken(_ttype
);
603 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
605 _returnToken
= _token
;
609 void RequirementLexer::mHEX(bool _createToken
) {
610 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
612 std::string::size_type _saveIndex
;
615 case 0x30 /* '0' */ :
616 case 0x31 /* '1' */ :
617 case 0x32 /* '2' */ :
618 case 0x33 /* '3' */ :
619 case 0x34 /* '4' */ :
620 case 0x35 /* '5' */ :
621 case 0x36 /* '6' */ :
622 case 0x37 /* '7' */ :
623 case 0x38 /* '8' */ :
624 case 0x39 /* '9' */ :
629 case 0x61 /* 'a' */ :
630 case 0x62 /* 'b' */ :
631 case 0x63 /* 'c' */ :
632 case 0x64 /* 'd' */ :
633 case 0x65 /* 'e' */ :
634 case 0x66 /* 'f' */ :
639 case 0x41 /* 'A' */ :
640 case 0x42 /* 'B' */ :
641 case 0x43 /* 'C' */ :
642 case 0x44 /* 'D' */ :
643 case 0x45 /* 'E' */ :
644 case 0x46 /* 'F' */ :
651 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
654 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
655 _token
= makeToken(_ttype
);
656 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
658 _returnToken
= _token
;
662 void RequirementLexer::mHEXCONSTANT(bool _createToken
) {
663 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
664 _ttype
= HEXCONSTANT
;
665 std::string::size_type _saveIndex
;
667 _saveIndex
= text
.length();
668 match('0' /* charlit */ );
669 text
.erase(_saveIndex
);
670 _saveIndex
= text
.length();
671 match('x' /* charlit */ );
672 text
.erase(_saveIndex
);
676 if ((_tokenSet_1
.member(LA(1)))) {
680 if ( _cnt60
>=1 ) { goto _loop60
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
687 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
688 _token
= makeToken(_ttype
);
689 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
691 _returnToken
= _token
;
695 void RequirementLexer::mSTRING(bool _createToken
) {
696 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
698 std::string::size_type _saveIndex
;
700 _saveIndex
= text
.length();
701 match('\"' /* charlit */ );
702 text
.erase(_saveIndex
);
706 case 0x5c /* '\\' */ :
709 _saveIndex
= text
.length();
710 match('\\' /* charlit */ );
711 text
.erase(_saveIndex
);
712 match('\"' /* charlit */ );
716 case 0x0 /* '\0' */ :
717 case 0x1 /* '\1' */ :
718 case 0x2 /* '\2' */ :
719 case 0x3 /* '\3' */ :
720 case 0x4 /* '\4' */ :
721 case 0x5 /* '\5' */ :
722 case 0x6 /* '\6' */ :
723 case 0x7 /* '\7' */ :
724 case 0x8 /* '\10' */ :
725 case 0x9 /* '\t' */ :
726 case 0xa /* '\n' */ :
727 case 0xb /* '\13' */ :
728 case 0xc /* '\14' */ :
729 case 0xd /* '\r' */ :
730 case 0xe /* '\16' */ :
731 case 0xf /* '\17' */ :
732 case 0x10 /* '\20' */ :
733 case 0x11 /* '\21' */ :
734 case 0x12 /* '\22' */ :
735 case 0x13 /* '\23' */ :
736 case 0x14 /* '\24' */ :
737 case 0x15 /* '\25' */ :
738 case 0x16 /* '\26' */ :
739 case 0x17 /* '\27' */ :
740 case 0x18 /* '\30' */ :
741 case 0x19 /* '\31' */ :
742 case 0x1a /* '\32' */ :
743 case 0x1b /* '\33' */ :
744 case 0x1c /* '\34' */ :
745 case 0x1d /* '\35' */ :
746 case 0x1e /* '\36' */ :
747 case 0x1f /* '\37' */ :
748 case 0x20 /* ' ' */ :
749 case 0x21 /* '!' */ :
750 case 0x23 /* '#' */ :
751 case 0x24 /* '$' */ :
752 case 0x25 /* '%' */ :
753 case 0x26 /* '&' */ :
754 case 0x27 /* '\'' */ :
755 case 0x28 /* '(' */ :
756 case 0x29 /* ')' */ :
757 case 0x2a /* '*' */ :
758 case 0x2b /* '+' */ :
759 case 0x2c /* ',' */ :
760 case 0x2d /* '-' */ :
761 case 0x2e /* '.' */ :
762 case 0x2f /* '/' */ :
763 case 0x30 /* '0' */ :
764 case 0x31 /* '1' */ :
765 case 0x32 /* '2' */ :
766 case 0x33 /* '3' */ :
767 case 0x34 /* '4' */ :
768 case 0x35 /* '5' */ :
769 case 0x36 /* '6' */ :
770 case 0x37 /* '7' */ :
771 case 0x38 /* '8' */ :
772 case 0x39 /* '9' */ :
773 case 0x3a /* ':' */ :
774 case 0x3b /* ';' */ :
775 case 0x3c /* '<' */ :
776 case 0x3d /* '=' */ :
777 case 0x3e /* '>' */ :
778 case 0x3f /* '?' */ :
779 case 0x40 /* '@' */ :
780 case 0x41 /* 'A' */ :
781 case 0x42 /* 'B' */ :
782 case 0x43 /* 'C' */ :
783 case 0x44 /* 'D' */ :
784 case 0x45 /* 'E' */ :
785 case 0x46 /* 'F' */ :
786 case 0x47 /* 'G' */ :
787 case 0x48 /* 'H' */ :
788 case 0x49 /* 'I' */ :
789 case 0x4a /* 'J' */ :
790 case 0x4b /* 'K' */ :
791 case 0x4c /* 'L' */ :
792 case 0x4d /* 'M' */ :
793 case 0x4e /* 'N' */ :
794 case 0x4f /* 'O' */ :
795 case 0x50 /* 'P' */ :
796 case 0x51 /* 'Q' */ :
797 case 0x52 /* 'R' */ :
798 case 0x53 /* 'S' */ :
799 case 0x54 /* 'T' */ :
800 case 0x55 /* 'U' */ :
801 case 0x56 /* 'V' */ :
802 case 0x57 /* 'W' */ :
803 case 0x58 /* 'X' */ :
804 case 0x59 /* 'Y' */ :
805 case 0x5a /* 'Z' */ :
806 case 0x5b /* '[' */ :
807 case 0x5d /* ']' */ :
808 case 0x5e /* '^' */ :
809 case 0x5f /* '_' */ :
810 case 0x60 /* '`' */ :
811 case 0x61 /* 'a' */ :
812 case 0x62 /* 'b' */ :
813 case 0x63 /* 'c' */ :
814 case 0x64 /* 'd' */ :
815 case 0x65 /* 'e' */ :
816 case 0x66 /* 'f' */ :
817 case 0x67 /* 'g' */ :
818 case 0x68 /* 'h' */ :
819 case 0x69 /* 'i' */ :
820 case 0x6a /* 'j' */ :
821 case 0x6b /* 'k' */ :
822 case 0x6c /* 'l' */ :
823 case 0x6d /* 'm' */ :
824 case 0x6e /* 'n' */ :
825 case 0x6f /* 'o' */ :
826 case 0x70 /* 'p' */ :
827 case 0x71 /* 'q' */ :
828 case 0x72 /* 'r' */ :
829 case 0x73 /* 's' */ :
830 case 0x74 /* 't' */ :
831 case 0x75 /* 'u' */ :
832 case 0x76 /* 'v' */ :
833 case 0x77 /* 'w' */ :
834 case 0x78 /* 'x' */ :
835 case 0x79 /* 'y' */ :
836 case 0x7a /* 'z' */ :
837 case 0x7b /* '{' */ :
838 case 0x7c /* '|' */ :
839 case 0x7d /* '}' */ :
840 case 0x7e /* '~' */ :
858 _saveIndex
= text
.length();
859 match('\"' /* charlit */ );
860 text
.erase(_saveIndex
);
861 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
862 _token
= makeToken(_ttype
);
863 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
865 _returnToken
= _token
;
869 void RequirementLexer::mARROW(bool _createToken
) {
870 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
872 std::string::size_type _saveIndex
;
875 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
876 _token
= makeToken(_ttype
);
877 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
879 _returnToken
= _token
;
883 void RequirementLexer::mSEMI(bool _createToken
) {
884 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
886 std::string::size_type _saveIndex
;
888 match(';' /* charlit */ );
889 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
890 _token
= makeToken(_ttype
);
891 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
893 _returnToken
= _token
;
897 void RequirementLexer::mLPAREN(bool _createToken
) {
898 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
900 std::string::size_type _saveIndex
;
902 match('(' /* charlit */ );
903 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
904 _token
= makeToken(_ttype
);
905 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
907 _returnToken
= _token
;
911 void RequirementLexer::mRPAREN(bool _createToken
) {
912 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
914 std::string::size_type _saveIndex
;
916 match(')' /* charlit */ );
917 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
918 _token
= makeToken(_ttype
);
919 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
921 _returnToken
= _token
;
925 void RequirementLexer::mLBRACK(bool _createToken
) {
926 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
928 std::string::size_type _saveIndex
;
930 match('[' /* charlit */ );
931 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
932 _token
= makeToken(_ttype
);
933 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
935 _returnToken
= _token
;
939 void RequirementLexer::mRBRACK(bool _createToken
) {
940 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
942 std::string::size_type _saveIndex
;
944 match(']' /* charlit */ );
945 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
946 _token
= makeToken(_ttype
);
947 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
949 _returnToken
= _token
;
953 void RequirementLexer::mLESS(bool _createToken
) {
954 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
956 std::string::size_type _saveIndex
;
958 match('<' /* charlit */ );
959 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
960 _token
= makeToken(_ttype
);
961 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
963 _returnToken
= _token
;
967 void RequirementLexer::mGT(bool _createToken
) {
968 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
970 std::string::size_type _saveIndex
;
972 match('>' /* charlit */ );
973 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
974 _token
= makeToken(_ttype
);
975 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
977 _returnToken
= _token
;
981 void RequirementLexer::mLE(bool _createToken
) {
982 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
984 std::string::size_type _saveIndex
;
987 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
988 _token
= makeToken(_ttype
);
989 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
991 _returnToken
= _token
;
995 void RequirementLexer::mGE(bool _createToken
) {
996 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
998 std::string::size_type _saveIndex
;
1001 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1002 _token
= makeToken(_ttype
);
1003 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1005 _returnToken
= _token
;
1009 void RequirementLexer::mCOMMA(bool _createToken
) {
1010 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1012 std::string::size_type _saveIndex
;
1014 match(',' /* charlit */ );
1015 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1016 _token
= makeToken(_ttype
);
1017 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1019 _returnToken
= _token
;
1023 void RequirementLexer::mEQL(bool _createToken
) {
1024 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1026 std::string::size_type _saveIndex
;
1028 match('=' /* charlit */ );
1029 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1030 _token
= makeToken(_ttype
);
1031 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1033 _returnToken
= _token
;
1037 void RequirementLexer::mEQQL(bool _createToken
) {
1038 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1040 std::string::size_type _saveIndex
;
1043 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1044 _token
= makeToken(_ttype
);
1045 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1047 _returnToken
= _token
;
1051 void RequirementLexer::mSUBS(bool _createToken
) {
1052 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1054 std::string::size_type _saveIndex
;
1056 match('~' /* charlit */ );
1057 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1058 _token
= makeToken(_ttype
);
1059 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1061 _returnToken
= _token
;
1065 void RequirementLexer::mNEG(bool _createToken
) {
1066 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1068 std::string::size_type _saveIndex
;
1070 match('-' /* charlit */ );
1071 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1072 _token
= makeToken(_ttype
);
1073 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1075 _returnToken
= _token
;
1079 void RequirementLexer::mNOT(bool _createToken
) {
1080 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1082 std::string::size_type _saveIndex
;
1084 match('!' /* charlit */ );
1085 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1086 _token
= makeToken(_ttype
);
1087 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1089 _returnToken
= _token
;
1093 void RequirementLexer::mSTAR(bool _createToken
) {
1094 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1096 std::string::size_type _saveIndex
;
1098 match('*' /* charlit */ );
1099 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1100 _token
= makeToken(_ttype
);
1101 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1103 _returnToken
= _token
;
1107 void RequirementLexer::mWS(bool _createToken
) {
1108 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1110 std::string::size_type _saveIndex
;
1116 case 0x20 /* ' ' */ :
1118 match(' ' /* charlit */ );
1121 case 0xa /* '\n' */ :
1123 match('\n' /* charlit */ );
1127 case 0x9 /* '\t' */ :
1129 match('\t' /* charlit */ );
1134 if ( _cnt90
>=1 ) { goto _loop90
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
1141 _ttype
= antlr::Token::SKIP
;
1142 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1143 _token
= makeToken(_ttype
);
1144 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1146 _returnToken
= _token
;
1150 void RequirementLexer::mSHELLCOMMENT(bool _createToken
) {
1151 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1152 _ttype
= SHELLCOMMENT
;
1153 std::string::size_type _saveIndex
;
1155 match('#' /* charlit */ );
1158 if ((_tokenSet_3
.member(LA(1)))) {
1159 matchNot('\n' /* charlit */ );
1168 _ttype
= antlr::Token::SKIP
;
1169 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1170 _token
= makeToken(_ttype
);
1171 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1173 _returnToken
= _token
;
1177 void RequirementLexer::mC_COMMENT(bool _createToken
) {
1178 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1180 std::string::size_type _saveIndex
;
1185 if ((LA(1) == 0x2a /* '*' */ ) && (_tokenSet_4
.member(LA(2)))) {
1187 match('*' /* charlit */ );
1189 matchNot('/' /* charlit */ );
1193 else if ((_tokenSet_5
.member(LA(1)))) {
1195 matchNot('*' /* charlit */ );
1206 _ttype
= antlr::Token::SKIP
;
1207 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1208 _token
= makeToken(_ttype
);
1209 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1211 _returnToken
= _token
;
1215 void RequirementLexer::mCPP_COMMENT(bool _createToken
) {
1216 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1217 _ttype
= CPP_COMMENT
;
1218 std::string::size_type _saveIndex
;
1223 if ((_tokenSet_3
.member(LA(1)))) {
1224 matchNot('\n' /* charlit */ );
1233 _ttype
= antlr::Token::SKIP
;
1234 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1235 _token
= makeToken(_ttype
);
1236 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1238 _returnToken
= _token
;
1243 const unsigned long RequirementLexer::_tokenSet_0_data_
[] = { 0UL, 0UL, 134217726UL, 134217726UL, 0UL, 0UL, 0UL, 0UL };
1244 const antlr::BitSet
RequirementLexer::_tokenSet_0(_tokenSet_0_data_
,8);
1245 const unsigned long RequirementLexer::_tokenSet_1_data_
[] = { 0UL, 67043328UL, 126UL, 126UL, 0UL, 0UL, 0UL, 0UL };
1246 // 0 1 2 3 4 5 6 7 8 9
1247 const antlr::BitSet
RequirementLexer::_tokenSet_1(_tokenSet_1_data_
,8);
1248 const unsigned long RequirementLexer::_tokenSet_2_data_
[] = { 4294967295UL, 4294967291UL, 4026531839UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL };
1249 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1250 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1251 // 0x1f ! # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
1252 const antlr::BitSet
RequirementLexer::_tokenSet_2(_tokenSet_2_data_
,8);
1253 const unsigned long RequirementLexer::_tokenSet_3_data_
[] = { 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL };
1254 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11
1255 // 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
1256 // ! \" # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9
1257 const antlr::BitSet
RequirementLexer::_tokenSet_3(_tokenSet_3_data_
,8);
1258 const unsigned long RequirementLexer::_tokenSet_4_data_
[] = { 4294967295UL, 4294934527UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL };
1259 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1260 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1261 // 0x1f ! \" # $ % & \' ( ) * + , - . 0 1 2 3 4 5 6 7 8 9
1262 const antlr::BitSet
RequirementLexer::_tokenSet_4(_tokenSet_4_data_
,8);
1263 const unsigned long RequirementLexer::_tokenSet_5_data_
[] = { 4294967295UL, 4294966271UL, 4294967295UL, 4294967295UL, 0UL, 0UL, 0UL, 0UL };
1264 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1265 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1266 // 0x1f ! \" # $ % & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9
1267 const antlr::BitSet
RequirementLexer::_tokenSet_5(_tokenSet_5_data_
,8);