]>
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 <libDER/libDER.h>
16 #include <libDER/asn1Types.h>
17 #include <security_utilities/cfutilities.h>
18 #include <security_utilities/hashing.h>
19 #include <security_cdsa_utilities/cssmdata.h> // OID coding
20 #include <Security/SecCertificate.h>
21 using namespace CodeSigning
;
22 typedef Requirement::Maker Maker
;
26 /* Decode a choice of UTCTime or GeneralizedTime to a CFAbsoluteTime. Return
27 an absoluteTime if the date was valid and properly decoded. Return
28 NULL_TIME otherwise. */
29 CFAbsoluteTime
SecAbsoluteTimeFromDateContent(DERTag tag
, const uint8_t *bytes
,
35 ANTLR_BEGIN_NAMESPACE(Security_CodeSigning
)
36 RequirementLexer::RequirementLexer(std::istream
& in
)
37 : antlr::CharScanner(new antlr::CharBuffer(in
),true)
42 RequirementLexer::RequirementLexer(antlr::InputBuffer
& ib
)
43 : antlr::CharScanner(ib
,true)
48 RequirementLexer::RequirementLexer(const antlr::LexerSharedInputState
& state
)
49 : antlr::CharScanner(state
,true)
54 void RequirementLexer::initLiterals()
56 literals
["certificate"] = 26;
57 literals
["always"] = 15;
59 literals
["guest"] = 5;
60 literals
["cdhash"] = 20;
61 literals
["entitlement"] = 30;
62 literals
["library"] = 8;
63 literals
["timestamp"] = 52;
64 literals
["never"] = 17;
65 literals
["cert"] = 27;
66 literals
["plugin"] = 9;
67 literals
["absent"] = 32;
69 literals
["leaf"] = 44;
70 literals
["info"] = 29;
71 literals
["designated"] = 7;
72 literals
["apple"] = 24;
73 literals
["trusted"] = 28;
74 literals
["true"] = 16;
75 literals
["notarized"] = 22;
77 literals
["root"] = 45;
78 literals
["platform"] = 21;
79 literals
["anchor"] = 23;
80 literals
["false"] = 18;
81 literals
["generic"] = 25;
82 literals
["identifier"] = 19;
83 literals
["exists"] = 31;
86 antlr::RefToken
RequirementLexer::nextToken()
88 antlr::RefToken theRetToken
;
90 antlr::RefToken theRetToken
;
91 int _ttype
= antlr::Token::INVALID_TYPE
;
93 try { // for lexical and char stream error handling
95 case 0x22 /* '\"' */ :
98 theRetToken
=_returnToken
;
101 case 0x3b /* ';' */ :
104 theRetToken
=_returnToken
;
107 case 0x28 /* '(' */ :
110 theRetToken
=_returnToken
;
113 case 0x29 /* ')' */ :
116 theRetToken
=_returnToken
;
119 case 0x5b /* '[' */ :
122 theRetToken
=_returnToken
;
125 case 0x5d /* ']' */ :
128 theRetToken
=_returnToken
;
131 case 0x2c /* ',' */ :
134 theRetToken
=_returnToken
;
137 case 0x7e /* '~' */ :
140 theRetToken
=_returnToken
;
143 case 0x2d /* '-' */ :
146 theRetToken
=_returnToken
;
149 case 0x21 /* '!' */ :
152 theRetToken
=_returnToken
;
155 case 0x2a /* '*' */ :
158 theRetToken
=_returnToken
;
161 case 0x9 /* '\t' */ :
162 case 0xa /* '\n' */ :
163 case 0x20 /* ' ' */ :
166 theRetToken
=_returnToken
;
169 case 0x23 /* '#' */ :
172 theRetToken
=_returnToken
;
176 if ((LA(1) == 0x2f /* '/' */ ) && (_tokenSet_0
.member(LA(2)))) {
178 theRetToken
=_returnToken
;
180 else if ((LA(1) == 0x48 /* 'H' */ ) && (LA(2) == 0x22 /* '\"' */ )) {
182 theRetToken
=_returnToken
;
184 else if ((LA(1) == 0x30 /* '0' */ ) && (LA(2) == 0x78 /* 'x' */ )) {
186 theRetToken
=_returnToken
;
188 else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3e /* '>' */ )) {
190 theRetToken
=_returnToken
;
192 else if ((LA(1) == 0x3c /* '<' */ ) && (LA(2) == 0x3d /* '=' */ )) {
194 theRetToken
=_returnToken
;
196 else if ((LA(1) == 0x3e /* '>' */ ) && (LA(2) == 0x3d /* '=' */ )) {
198 theRetToken
=_returnToken
;
200 else if ((LA(1) == 0x3d /* '=' */ ) && (LA(2) == 0x3d /* '=' */ )) {
202 theRetToken
=_returnToken
;
204 else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2a /* '*' */ )) {
206 theRetToken
=_returnToken
;
208 else if ((LA(1) == 0x2f /* '/' */ ) && (LA(2) == 0x2f /* '/' */ )) {
210 theRetToken
=_returnToken
;
212 else if ((_tokenSet_0
.member(LA(1))) && (true)) {
214 theRetToken
=_returnToken
;
216 else if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ )) && (true)) {
218 theRetToken
=_returnToken
;
220 else if ((LA(1) == 0x3c /* '<' */ ) && (true)) {
222 theRetToken
=_returnToken
;
224 else if ((LA(1) == 0x3e /* '>' */ ) && (true)) {
226 theRetToken
=_returnToken
;
228 else if ((LA(1) == 0x3d /* '=' */ ) && (true)) {
230 theRetToken
=_returnToken
;
236 _returnToken
= makeToken(antlr::Token::EOF_TYPE
);
238 else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
242 goto tryAgain
; // found SKIP token
244 _ttype
= _returnToken
->getType();
245 _returnToken
->setType(_ttype
);
248 catch (antlr::RecognitionException
& e
) {
249 throw antlr::TokenStreamRecognitionException(e
);
251 catch (antlr::CharStreamIOException
& csie
) {
252 throw antlr::TokenStreamIOException(csie
.io
);
254 catch (antlr::CharStreamException
& cse
) {
255 throw antlr::TokenStreamException(cse
.getMessage());
261 void RequirementLexer::mIDENT(bool _createToken
) {
262 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
264 std::string::size_type _saveIndex
;
268 case 0x41 /* 'A' */ :
269 case 0x42 /* 'B' */ :
270 case 0x43 /* 'C' */ :
271 case 0x44 /* 'D' */ :
272 case 0x45 /* 'E' */ :
273 case 0x46 /* 'F' */ :
274 case 0x47 /* 'G' */ :
275 case 0x48 /* 'H' */ :
276 case 0x49 /* 'I' */ :
277 case 0x4a /* 'J' */ :
278 case 0x4b /* 'K' */ :
279 case 0x4c /* 'L' */ :
280 case 0x4d /* 'M' */ :
281 case 0x4e /* 'N' */ :
282 case 0x4f /* 'O' */ :
283 case 0x50 /* 'P' */ :
284 case 0x51 /* 'Q' */ :
285 case 0x52 /* 'R' */ :
286 case 0x53 /* 'S' */ :
287 case 0x54 /* 'T' */ :
288 case 0x55 /* 'U' */ :
289 case 0x56 /* 'V' */ :
290 case 0x57 /* 'W' */ :
291 case 0x58 /* 'X' */ :
292 case 0x59 /* 'Y' */ :
293 case 0x5a /* 'Z' */ :
298 case 0x61 /* 'a' */ :
299 case 0x62 /* 'b' */ :
300 case 0x63 /* 'c' */ :
301 case 0x64 /* 'd' */ :
302 case 0x65 /* 'e' */ :
303 case 0x66 /* 'f' */ :
304 case 0x67 /* 'g' */ :
305 case 0x68 /* 'h' */ :
306 case 0x69 /* 'i' */ :
307 case 0x6a /* 'j' */ :
308 case 0x6b /* 'k' */ :
309 case 0x6c /* 'l' */ :
310 case 0x6d /* 'm' */ :
311 case 0x6e /* 'n' */ :
312 case 0x6f /* 'o' */ :
313 case 0x70 /* 'p' */ :
314 case 0x71 /* 'q' */ :
315 case 0x72 /* 'r' */ :
316 case 0x73 /* 's' */ :
317 case 0x74 /* 't' */ :
318 case 0x75 /* 'u' */ :
319 case 0x76 /* 'v' */ :
320 case 0x77 /* 'w' */ :
321 case 0x78 /* 'x' */ :
322 case 0x79 /* 'y' */ :
323 case 0x7a /* 'z' */ :
330 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
337 case 0x41 /* 'A' */ :
338 case 0x42 /* 'B' */ :
339 case 0x43 /* 'C' */ :
340 case 0x44 /* 'D' */ :
341 case 0x45 /* 'E' */ :
342 case 0x46 /* 'F' */ :
343 case 0x47 /* 'G' */ :
344 case 0x48 /* 'H' */ :
345 case 0x49 /* 'I' */ :
346 case 0x4a /* 'J' */ :
347 case 0x4b /* 'K' */ :
348 case 0x4c /* 'L' */ :
349 case 0x4d /* 'M' */ :
350 case 0x4e /* 'N' */ :
351 case 0x4f /* 'O' */ :
352 case 0x50 /* 'P' */ :
353 case 0x51 /* 'Q' */ :
354 case 0x52 /* 'R' */ :
355 case 0x53 /* 'S' */ :
356 case 0x54 /* 'T' */ :
357 case 0x55 /* 'U' */ :
358 case 0x56 /* 'V' */ :
359 case 0x57 /* 'W' */ :
360 case 0x58 /* 'X' */ :
361 case 0x59 /* 'Y' */ :
362 case 0x5a /* 'Z' */ :
367 case 0x61 /* 'a' */ :
368 case 0x62 /* 'b' */ :
369 case 0x63 /* 'c' */ :
370 case 0x64 /* 'd' */ :
371 case 0x65 /* 'e' */ :
372 case 0x66 /* 'f' */ :
373 case 0x67 /* 'g' */ :
374 case 0x68 /* 'h' */ :
375 case 0x69 /* 'i' */ :
376 case 0x6a /* 'j' */ :
377 case 0x6b /* 'k' */ :
378 case 0x6c /* 'l' */ :
379 case 0x6d /* 'm' */ :
380 case 0x6e /* 'n' */ :
381 case 0x6f /* 'o' */ :
382 case 0x70 /* 'p' */ :
383 case 0x71 /* 'q' */ :
384 case 0x72 /* 'r' */ :
385 case 0x73 /* 's' */ :
386 case 0x74 /* 't' */ :
387 case 0x75 /* 'u' */ :
388 case 0x76 /* 'v' */ :
389 case 0x77 /* 'w' */ :
390 case 0x78 /* 'x' */ :
391 case 0x79 /* 'y' */ :
392 case 0x7a /* 'z' */ :
397 case 0x30 /* '0' */ :
398 case 0x31 /* '1' */ :
399 case 0x32 /* '2' */ :
400 case 0x33 /* '3' */ :
401 case 0x34 /* '4' */ :
402 case 0x35 /* '5' */ :
403 case 0x36 /* '6' */ :
404 case 0x37 /* '7' */ :
405 case 0x38 /* '8' */ :
406 case 0x39 /* '9' */ :
419 _ttype
= testLiteralsTable(text
.substr(_begin
, text
.length()-_begin
),_ttype
);
420 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
421 _token
= makeToken(_ttype
);
422 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
424 _returnToken
= _token
;
428 void RequirementLexer::mDOTKEY(bool _createToken
) {
429 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
431 std::string::size_type _saveIndex
;
436 if ((LA(1) == 0x2e /* '.' */ )) {
440 case 0x41 /* 'A' */ :
441 case 0x42 /* 'B' */ :
442 case 0x43 /* 'C' */ :
443 case 0x44 /* 'D' */ :
444 case 0x45 /* 'E' */ :
445 case 0x46 /* 'F' */ :
446 case 0x47 /* 'G' */ :
447 case 0x48 /* 'H' */ :
448 case 0x49 /* 'I' */ :
449 case 0x4a /* 'J' */ :
450 case 0x4b /* 'K' */ :
451 case 0x4c /* 'L' */ :
452 case 0x4d /* 'M' */ :
453 case 0x4e /* 'N' */ :
454 case 0x4f /* 'O' */ :
455 case 0x50 /* 'P' */ :
456 case 0x51 /* 'Q' */ :
457 case 0x52 /* 'R' */ :
458 case 0x53 /* 'S' */ :
459 case 0x54 /* 'T' */ :
460 case 0x55 /* 'U' */ :
461 case 0x56 /* 'V' */ :
462 case 0x57 /* 'W' */ :
463 case 0x58 /* 'X' */ :
464 case 0x59 /* 'Y' */ :
465 case 0x5a /* 'Z' */ :
466 case 0x61 /* 'a' */ :
467 case 0x62 /* 'b' */ :
468 case 0x63 /* 'c' */ :
469 case 0x64 /* 'd' */ :
470 case 0x65 /* 'e' */ :
471 case 0x66 /* 'f' */ :
472 case 0x67 /* 'g' */ :
473 case 0x68 /* 'h' */ :
474 case 0x69 /* 'i' */ :
475 case 0x6a /* 'j' */ :
476 case 0x6b /* 'k' */ :
477 case 0x6c /* 'l' */ :
478 case 0x6d /* 'm' */ :
479 case 0x6e /* 'n' */ :
480 case 0x6f /* 'o' */ :
481 case 0x70 /* 'p' */ :
482 case 0x71 /* 'q' */ :
483 case 0x72 /* 'r' */ :
484 case 0x73 /* 's' */ :
485 case 0x74 /* 't' */ :
486 case 0x75 /* 'u' */ :
487 case 0x76 /* 'v' */ :
488 case 0x77 /* 'w' */ :
489 case 0x78 /* 'x' */ :
490 case 0x79 /* 'y' */ :
491 case 0x7a /* 'z' */ :
496 case 0x30 /* '0' */ :
497 case 0x31 /* '1' */ :
498 case 0x32 /* '2' */ :
499 case 0x33 /* '3' */ :
500 case 0x34 /* '4' */ :
501 case 0x35 /* '5' */ :
502 case 0x36 /* '6' */ :
503 case 0x37 /* '7' */ :
504 case 0x38 /* '8' */ :
505 case 0x39 /* '9' */ :
512 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
524 _ttype
= testLiteralsTable(_ttype
);
525 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
526 _token
= makeToken(_ttype
);
527 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
529 _returnToken
= _token
;
533 void RequirementLexer::mINTEGER(bool _createToken
) {
534 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
536 std::string::size_type _saveIndex
;
541 if (((LA(1) >= 0x30 /* '0' */ && LA(1) <= 0x39 /* '9' */ ))) {
545 if ( _cnt71
>=1 ) { goto _loop71
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
552 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
553 _token
= makeToken(_ttype
);
554 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
556 _returnToken
= _token
;
560 void RequirementLexer::mPATHNAME(bool _createToken
) {
561 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
563 std::string::size_type _saveIndex
;
570 if ((LA(1) == 0x2f /* '/' */ )) {
575 if ( _cnt56
>=1 ) { goto _loop56
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
582 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
583 _token
= makeToken(_ttype
);
584 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
586 _returnToken
= _token
;
590 void RequirementLexer::mHASHCONSTANT(bool _createToken
) {
591 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
592 _ttype
= HASHCONSTANT
;
593 std::string::size_type _saveIndex
;
595 _saveIndex
= text
.length();
596 match('H' /* charlit */ );
597 text
.erase(_saveIndex
);
598 _saveIndex
= text
.length();
599 match('\"' /* charlit */ );
600 text
.erase(_saveIndex
);
604 if ((_tokenSet_1
.member(LA(1)))) {
608 if ( _cnt59
>=1 ) { goto _loop59
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
615 _saveIndex
= text
.length();
616 match('\"' /* charlit */ );
617 text
.erase(_saveIndex
);
618 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
619 _token
= makeToken(_ttype
);
620 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
622 _returnToken
= _token
;
626 void RequirementLexer::mHEX(bool _createToken
) {
627 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
629 std::string::size_type _saveIndex
;
632 case 0x30 /* '0' */ :
633 case 0x31 /* '1' */ :
634 case 0x32 /* '2' */ :
635 case 0x33 /* '3' */ :
636 case 0x34 /* '4' */ :
637 case 0x35 /* '5' */ :
638 case 0x36 /* '6' */ :
639 case 0x37 /* '7' */ :
640 case 0x38 /* '8' */ :
641 case 0x39 /* '9' */ :
646 case 0x61 /* 'a' */ :
647 case 0x62 /* 'b' */ :
648 case 0x63 /* 'c' */ :
649 case 0x64 /* 'd' */ :
650 case 0x65 /* 'e' */ :
651 case 0x66 /* 'f' */ :
656 case 0x41 /* 'A' */ :
657 case 0x42 /* 'B' */ :
658 case 0x43 /* 'C' */ :
659 case 0x44 /* 'D' */ :
660 case 0x45 /* 'E' */ :
661 case 0x46 /* 'F' */ :
668 throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());
671 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
672 _token
= makeToken(_ttype
);
673 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
675 _returnToken
= _token
;
679 void RequirementLexer::mHEXCONSTANT(bool _createToken
) {
680 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
681 _ttype
= HEXCONSTANT
;
682 std::string::size_type _saveIndex
;
684 _saveIndex
= text
.length();
685 match('0' /* charlit */ );
686 text
.erase(_saveIndex
);
687 _saveIndex
= text
.length();
688 match('x' /* charlit */ );
689 text
.erase(_saveIndex
);
693 if ((_tokenSet_1
.member(LA(1)))) {
697 if ( _cnt62
>=1 ) { goto _loop62
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
704 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
705 _token
= makeToken(_ttype
);
706 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
708 _returnToken
= _token
;
712 void RequirementLexer::mSTRING(bool _createToken
) {
713 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
715 std::string::size_type _saveIndex
;
717 _saveIndex
= text
.length();
718 match('\"' /* charlit */ );
719 text
.erase(_saveIndex
);
722 if ((LA(1) == 0x5c /* '\\' */ )) {
724 _saveIndex
= text
.length();
725 match('\\' /* charlit */ );
726 text
.erase(_saveIndex
);
727 match('\"' /* charlit */ );
730 else if ((_tokenSet_2
.member(LA(1)))) {
744 _saveIndex
= text
.length();
745 match('\"' /* charlit */ );
746 text
.erase(_saveIndex
);
747 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
748 _token
= makeToken(_ttype
);
749 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
751 _returnToken
= _token
;
755 void RequirementLexer::mARROW(bool _createToken
) {
756 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
758 std::string::size_type _saveIndex
;
761 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
762 _token
= makeToken(_ttype
);
763 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
765 _returnToken
= _token
;
769 void RequirementLexer::mSEMI(bool _createToken
) {
770 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
772 std::string::size_type _saveIndex
;
774 match(';' /* charlit */ );
775 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
776 _token
= makeToken(_ttype
);
777 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
779 _returnToken
= _token
;
783 void RequirementLexer::mLPAREN(bool _createToken
) {
784 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
786 std::string::size_type _saveIndex
;
788 match('(' /* charlit */ );
789 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
790 _token
= makeToken(_ttype
);
791 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
793 _returnToken
= _token
;
797 void RequirementLexer::mRPAREN(bool _createToken
) {
798 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
800 std::string::size_type _saveIndex
;
802 match(')' /* charlit */ );
803 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
804 _token
= makeToken(_ttype
);
805 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
807 _returnToken
= _token
;
811 void RequirementLexer::mLBRACK(bool _createToken
) {
812 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
814 std::string::size_type _saveIndex
;
816 match('[' /* charlit */ );
817 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
818 _token
= makeToken(_ttype
);
819 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
821 _returnToken
= _token
;
825 void RequirementLexer::mRBRACK(bool _createToken
) {
826 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
828 std::string::size_type _saveIndex
;
830 match(']' /* charlit */ );
831 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
832 _token
= makeToken(_ttype
);
833 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
835 _returnToken
= _token
;
839 void RequirementLexer::mLESS(bool _createToken
) {
840 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
842 std::string::size_type _saveIndex
;
844 match('<' /* charlit */ );
845 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
846 _token
= makeToken(_ttype
);
847 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
849 _returnToken
= _token
;
853 void RequirementLexer::mGT(bool _createToken
) {
854 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
856 std::string::size_type _saveIndex
;
858 match('>' /* charlit */ );
859 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
860 _token
= makeToken(_ttype
);
861 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
863 _returnToken
= _token
;
867 void RequirementLexer::mLE(bool _createToken
) {
868 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
870 std::string::size_type _saveIndex
;
873 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
874 _token
= makeToken(_ttype
);
875 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
877 _returnToken
= _token
;
881 void RequirementLexer::mGE(bool _createToken
) {
882 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
884 std::string::size_type _saveIndex
;
887 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
888 _token
= makeToken(_ttype
);
889 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
891 _returnToken
= _token
;
895 void RequirementLexer::mCOMMA(bool _createToken
) {
896 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
898 std::string::size_type _saveIndex
;
900 match(',' /* charlit */ );
901 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
902 _token
= makeToken(_ttype
);
903 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
905 _returnToken
= _token
;
909 void RequirementLexer::mEQL(bool _createToken
) {
910 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
912 std::string::size_type _saveIndex
;
914 match('=' /* charlit */ );
915 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
916 _token
= makeToken(_ttype
);
917 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
919 _returnToken
= _token
;
923 void RequirementLexer::mEQQL(bool _createToken
) {
924 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
926 std::string::size_type _saveIndex
;
929 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
930 _token
= makeToken(_ttype
);
931 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
933 _returnToken
= _token
;
937 void RequirementLexer::mSUBS(bool _createToken
) {
938 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
940 std::string::size_type _saveIndex
;
942 match('~' /* charlit */ );
943 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
944 _token
= makeToken(_ttype
);
945 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
947 _returnToken
= _token
;
951 void RequirementLexer::mNEG(bool _createToken
) {
952 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
954 std::string::size_type _saveIndex
;
956 match('-' /* charlit */ );
957 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
958 _token
= makeToken(_ttype
);
959 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
961 _returnToken
= _token
;
965 void RequirementLexer::mNOT(bool _createToken
) {
966 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
968 std::string::size_type _saveIndex
;
970 match('!' /* charlit */ );
971 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
972 _token
= makeToken(_ttype
);
973 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
975 _returnToken
= _token
;
979 void RequirementLexer::mSTAR(bool _createToken
) {
980 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
982 std::string::size_type _saveIndex
;
984 match('*' /* charlit */ );
985 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
986 _token
= makeToken(_ttype
);
987 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
989 _returnToken
= _token
;
993 void RequirementLexer::mWS(bool _createToken
) {
994 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
996 std::string::size_type _saveIndex
;
1002 case 0x20 /* ' ' */ :
1004 match(' ' /* charlit */ );
1007 case 0xa /* '\n' */ :
1009 match('\n' /* charlit */ );
1013 case 0x9 /* '\t' */ :
1015 match('\t' /* charlit */ );
1020 if ( _cnt92
>=1 ) { goto _loop92
; } else {throw antlr::NoViableAltForCharException(LA(1), getFilename(), getLine(), getColumn());}
1027 _ttype
= antlr::Token::SKIP
;
1028 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1029 _token
= makeToken(_ttype
);
1030 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1032 _returnToken
= _token
;
1036 void RequirementLexer::mSHELLCOMMENT(bool _createToken
) {
1037 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1038 _ttype
= SHELLCOMMENT
;
1039 std::string::size_type _saveIndex
;
1041 match('#' /* charlit */ );
1044 if ((_tokenSet_3
.member(LA(1)))) {
1045 matchNot('\n' /* charlit */ );
1054 _ttype
= antlr::Token::SKIP
;
1055 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1056 _token
= makeToken(_ttype
);
1057 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1059 _returnToken
= _token
;
1063 void RequirementLexer::mC_COMMENT(bool _createToken
) {
1064 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1066 std::string::size_type _saveIndex
;
1071 if ((LA(1) == 0x2a /* '*' */ ) && (_tokenSet_4
.member(LA(2)))) {
1073 match('*' /* charlit */ );
1075 matchNot('/' /* charlit */ );
1079 else if ((_tokenSet_5
.member(LA(1)))) {
1081 matchNot('*' /* charlit */ );
1092 _ttype
= antlr::Token::SKIP
;
1093 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1094 _token
= makeToken(_ttype
);
1095 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1097 _returnToken
= _token
;
1101 void RequirementLexer::mCPP_COMMENT(bool _createToken
) {
1102 int _ttype
; antlr::RefToken _token
; std::string::size_type _begin
= text
.length();
1103 _ttype
= CPP_COMMENT
;
1104 std::string::size_type _saveIndex
;
1109 if ((_tokenSet_3
.member(LA(1)))) {
1110 matchNot('\n' /* charlit */ );
1119 _ttype
= antlr::Token::SKIP
;
1120 if ( _createToken
&& _token
==antlr::nullToken
&& _ttype
!=antlr::Token::SKIP
) {
1121 _token
= makeToken(_ttype
);
1122 _token
->setText(text
.substr(_begin
, text
.length()-_begin
));
1124 _returnToken
= _token
;
1129 const unsigned long RequirementLexer::_tokenSet_0_data_
[] = { 0UL, 0UL, 134217726UL, 134217726UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1130 const antlr::BitSet
RequirementLexer::_tokenSet_0(_tokenSet_0_data_
,10);
1131 const unsigned long RequirementLexer::_tokenSet_1_data_
[] = { 0UL, 67043328UL, 126UL, 126UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1132 // 0 1 2 3 4 5 6 7 8 9
1133 const antlr::BitSet
RequirementLexer::_tokenSet_1(_tokenSet_1_data_
,10);
1134 const unsigned long RequirementLexer::_tokenSet_2_data_
[] = { 4294967295UL, 4294967291UL, 4026531839UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1135 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1136 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1137 // 0x1f ! # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; <
1138 const antlr::BitSet
RequirementLexer::_tokenSet_2(_tokenSet_2_data_
,16);
1139 const unsigned long RequirementLexer::_tokenSet_3_data_
[] = { 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1140 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xb 0xc 0xd 0xe 0xf 0x10 0x11
1141 // 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e 0x1f
1142 // ! \" # $ % & \' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; <
1143 const antlr::BitSet
RequirementLexer::_tokenSet_3(_tokenSet_3_data_
,16);
1144 const unsigned long RequirementLexer::_tokenSet_4_data_
[] = { 4294967295UL, 4294934527UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1145 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1146 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1147 // 0x1f ! \" # $ % & \' ( ) * + , - . 0 1 2 3 4 5 6 7 8 9 : ; <
1148 const antlr::BitSet
RequirementLexer::_tokenSet_4(_tokenSet_4_data_
,16);
1149 const unsigned long RequirementLexer::_tokenSet_5_data_
[] = { 4294967295UL, 4294966271UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967295UL, 4294967292UL, 2097151UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL, 0UL };
1150 // 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf 0x10
1151 // 0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 0x19 0x1a 0x1b 0x1c 0x1d 0x1e
1152 // 0x1f ! \" # $ % & \' ( ) + , - . / 0 1 2 3 4 5 6 7 8 9 : ; <
1153 const antlr::BitSet
RequirementLexer::_tokenSet_5(_tokenSet_5_data_
,16);