Source Code Cross Referenced for ThemeLexer.java in  » Development » ivatamasks » com » ivata » mask » web » theme » parser » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » ivatamasks » com.ivata.mask.web.theme.parser 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        // $ANTLR : "theme.g" -> "ThemeLexer.java"$
0002:
0003:        package com.ivata.mask.web.theme.parser;
0004:
0005:        import java.io.InputStream;
0006:        import java.io.Reader;
0007:        import java.util.Hashtable;
0008:        import java.util.Properties;
0009:
0010:        import org.apache.log4j.Logger;
0011:
0012:        import antlr.ByteBuffer;
0013:        import antlr.CharBuffer;
0014:        import antlr.CharStreamException;
0015:        import antlr.CharStreamIOException;
0016:        import antlr.InputBuffer;
0017:        import antlr.LexerSharedInputState;
0018:        import antlr.NoViableAltForCharException;
0019:        import antlr.RecognitionException;
0020:        import antlr.Token;
0021:        import antlr.TokenStream;
0022:        import antlr.TokenStreamException;
0023:        import antlr.TokenStreamIOException;
0024:        import antlr.TokenStreamRecognitionException;
0025:        import antlr.collections.impl.BitSet;
0026:
0027:        import com.ivata.mask.util.StringHandling;
0028:
0029:        /**
0030:         * <p>This is ivata's theme lexical scanner, automatically generated by
0031:         * <a href='http://www.antlr.org'>antlr</a>.</p>
0032:         *
0033:         * <br/><hr><h3>revision history</h3>
0034:         * <br/> $Log: ThemeLexer.java,v $
0035:         * <br/> Revision 1.9  2005/10/12 18:35:57  colinmacleod
0036:         * <br/> Standardized format of Logger declaration - to make it easier to find instances
0037:         * <br/> which are not both static and final.
0038:         * <br/>
0039:         * <br/> Revision 1.8  2005/10/03 10:17:26  colinmacleod
0040:         * <br/> Fixed some style and javadoc issues.
0041:         * <br/>
0042:         * <br/> Revision 1.5  2005/04/12 11:07:40  colinmacleod
0043:         * <br/> Added logger to improve error
0044:         * <br/> handling.
0045:         * <br/> Checked for empty strings when
0046:         * <br/> converting numbers in lexer.
0047:         * <br/>
0048:         * <br/> Revision 1.4  2005/04/11 12:11:59  colinmacleod
0049:         * <br/> Fixed comment (removed HTML style start and
0050:         * <br/> end to comment).
0051:         * <br/>
0052:         * <br/> Revision 1.3  2005/04/09 18:04:22  colinmacleod
0053:         * <br/> Changed copyright text to GPL v2 explicitly.
0054:         * <br/>
0055:         * <br/> Revision 1.2  2005/01/19 13:07:19  colinmacleod
0056:         * <br/> Updated comment format to include version in since line.
0057:         * <br/>
0058:         * <br/> Revision 1.1  2005/01/06 22:03:49  colinmacleod
0059:         * <br/> Moved up a version number.
0060:         * <br/> Changed copyright notices to 2005.
0061:         * <br/> Updated the documentation:
0062:         * <br/>   - started working on multiproject:site docu.
0063:         * <br/>   - changed the logo.
0064:         * <br/> Added checkstyle and fixed LOADS of style issues.
0065:         * <br/> Added separate thirdparty subproject.
0066:         * <br/> Added struts (in web), util and webgui (in webtheme) from ivata op.
0067:         * <br/>
0068:         * <br/> Revision 1.3  2004/11/03 16:16:45  colinmacleod
0069:         * <br/> Removed System.out.print("TEST")
0070:         * <br/>
0071:         * <br/> Revision 1.2  2004/03/21 21:16:38  colinmacleod
0072:         * <br/> Shortened name to ivata op.
0073:         * <br/>
0074:         * <br/> Revision 1.1.1.1  2004/01/27 20:59:53  colinmacleod
0075:         * <br/> Moved ivata op to SourceForge.
0076:         * <br/>
0077:         * <br/> Revision 1.2  2003/10/15 14:13:40  colin
0078:         * <br/> fixinf for XDoclet
0079:         * <br/>
0080:         * <br/> Revision 1.3  2003/02/28 15:29:50  colin
0081:         * <br/> made CONDITIONAL_CONTENT optional to fix bug in tabs
0082:         * <br/>
0083:         * <br/> Revision 1.2  2003/02/28 13:59:25  colin
0084:         * <br/> updated to fix bug with some characters in CONDITIONAL_CONTENT
0085:         * <br/> implemented ATTRIBUTE_VALUE
0086:         * <br/>
0087:         * <br/> Revision 1.1  2003/02/24 19:33:33  colin
0088:         * <br/> Moved to new subproject.
0089:         * <br/>
0090:         * </i><br/><br/><hr>
0091:         * @since ivata masks 0.4 (2001-06-29)
0092:         * @author Colin MacLeod
0093:         * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
0094:         * @version $Revision: 1.9 $
0095:         * @see     com.ivata.mask.web.theme
0096:         */
0097:        public class ThemeLexer extends antlr.CharScanner implements 
0098:                ThemeParserTokenTypes, TokenStream {
0099:
0100:            /**
0101:             * Logger for this class.
0102:             */
0103:            private static final Logger logger = Logger
0104:                    .getLogger(ThemeLexer.class);
0105:            private Properties properties;
0106:
0107:            public void setProperties(Properties properties) {
0108:                this .properties = properties;
0109:            }
0110:
0111:            private java.lang.StringBuffer buffer = new java.lang.StringBuffer();
0112:
0113:            public String toString() {
0114:                return buffer.toString();
0115:            }
0116:
0117:            /**
0118:             * <p>Used internally to convert strings to <code>int</code> values safely.
0119:             * </p>
0120:             *
0121:             * @return <code>0</code> if the string is <code>null</code> or otherwise
0122:             * cannot be converted.
0123:             * Otherwise, the numeric value of the string is returned.
0124:             */
0125:            private int convertStringToInt(String convert) {
0126:                if (StringHandling.isNullOrEmpty(convert)) {
0127:                    return 0;
0128:                }
0129:                Integer integer;
0130:                try {
0131:                    integer = new Integer(convert);
0132:                } catch (NumberFormatException e) {
0133:                    logger.warn(e.getClass().getName()
0134:                            + " in theme lexer trying to format '" + convert
0135:                            + "' as a number: " + e.getMessage(), e);
0136:                    return 0;
0137:                }
0138:                return integer.intValue();
0139:            }
0140:
0141:            public ThemeLexer(InputStream in) {
0142:                this (new ByteBuffer(in));
0143:            }
0144:
0145:            public ThemeLexer(Reader in) {
0146:                this (new CharBuffer(in));
0147:            }
0148:
0149:            public ThemeLexer(InputBuffer ib) {
0150:                this (new LexerSharedInputState(ib));
0151:            }
0152:
0153:            public ThemeLexer(LexerSharedInputState state) {
0154:                super (state);
0155:                caseSensitiveLiterals = true;
0156:                setCaseSensitive(true);
0157:                literals = new Hashtable();
0158:            }
0159:
0160:            public Token nextToken() throws TokenStreamException {
0161:                tryAgain: for (;;) {
0162:                    int _ttype = Token.INVALID_TYPE;
0163:                    setCommitToPath(false);
0164:                    int _m;
0165:                    _m = mark();
0166:                    resetText();
0167:                    try { // for char stream error handling
0168:                        try { // for lexical error handling
0169:                            switch (LA(1)) {
0170:                            case 'M': {
0171:                                mMATH(true);
0172:                                break;
0173:                            }
0174:                            case 'I': {
0175:                                mCONDITION(true);
0176:                                break;
0177:                            }
0178:                            case 'A': {
0179:                                mATTRIBUTE(true);
0180:                                break;
0181:                            }
0182:                            case 'P': {
0183:                                mPROPERTY(true);
0184:                                break;
0185:                            }
0186:                            default: {
0187:                                if (LA(1) == EOF_CHAR) {
0188:                                    uponEOF();
0189:                                    _returnToken = makeToken(Token.EOF_TYPE);
0190:                                } else {
0191:                                    commit();
0192:                                    try {
0193:                                        mIGNORE(false);
0194:                                    } catch (RecognitionException e) {
0195:                                        // catastrophic failure
0196:                                        reportError(e);
0197:                                        consume();
0198:                                    }
0199:                                    continue tryAgain;
0200:                                }
0201:                            }
0202:                            }
0203:                            commit();
0204:                            if (_returnToken == null)
0205:                                continue tryAgain; // found SKIP token
0206:                            _ttype = _returnToken.getType();
0207:                            _ttype = testLiteralsTable(_ttype);
0208:                            _returnToken.setType(_ttype);
0209:                            return _returnToken;
0210:                        } catch (RecognitionException e) {
0211:                            if (!getCommitToPath()) {
0212:                                rewind(_m);
0213:                                resetText();
0214:                                try {
0215:                                    mIGNORE(false);
0216:                                } catch (RecognitionException ee) {
0217:                                    // horrendous failure: error in filter rule
0218:                                    reportError(ee);
0219:                                    consume();
0220:                                }
0221:                                continue tryAgain;
0222:                            }
0223:                            throw new TokenStreamRecognitionException(e);
0224:                        }
0225:                    } catch (CharStreamException cse) {
0226:                        if (cse instanceof  CharStreamIOException) {
0227:                            throw new TokenStreamIOException(
0228:                                    ((CharStreamIOException) cse).io);
0229:                        } else {
0230:                            throw new TokenStreamException(cse.getMessage());
0231:                        }
0232:                    }
0233:                }
0234:            }
0235:
0236:            protected final void mLPAREN(boolean _createToken)
0237:                    throws RecognitionException, CharStreamException,
0238:                    TokenStreamException {
0239:                int _ttype;
0240:                Token _token = null;
0241:                int _begin = text.length();
0242:                _ttype = LPAREN;
0243:                match('(');
0244:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0245:                    _token = makeToken(_ttype);
0246:                    _token.setText(new String(text.getBuffer(), _begin, text
0247:                            .length()
0248:                            - _begin));
0249:                }
0250:                _returnToken = _token;
0251:            }
0252:
0253:            protected final void mRPAREN(boolean _createToken)
0254:                    throws RecognitionException, CharStreamException,
0255:                    TokenStreamException {
0256:                int _ttype;
0257:                Token _token = null;
0258:                int _begin = text.length();
0259:                _ttype = RPAREN;
0260:                match(')');
0261:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0262:                    _token = makeToken(_ttype);
0263:                    _token.setText(new String(text.getBuffer(), _begin, text
0264:                            .length()
0265:                            - _begin));
0266:                }
0267:                _returnToken = _token;
0268:            }
0269:
0270:            protected final void mCOLON(boolean _createToken)
0271:                    throws RecognitionException, CharStreamException,
0272:                    TokenStreamException {
0273:                int _ttype;
0274:                Token _token = null;
0275:                int _begin = text.length();
0276:                _ttype = COLON;
0277:                match(':');
0278:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0279:                    _token = makeToken(_ttype);
0280:                    _token.setText(new String(text.getBuffer(), _begin, text
0281:                            .length()
0282:                            - _begin));
0283:                }
0284:                _returnToken = _token;
0285:            }
0286:
0287:            protected final void mCOMMA(boolean _createToken)
0288:                    throws RecognitionException, CharStreamException,
0289:                    TokenStreamException {
0290:                int _ttype;
0291:                Token _token = null;
0292:                int _begin = text.length();
0293:                _ttype = COMMA;
0294:                match(',');
0295:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0296:                    _token = makeToken(_ttype);
0297:                    _token.setText(new String(text.getBuffer(), _begin, text
0298:                            .length()
0299:                            - _begin));
0300:                }
0301:                _returnToken = _token;
0302:            }
0303:
0304:            protected final void mLBRACE(boolean _createToken)
0305:                    throws RecognitionException, CharStreamException,
0306:                    TokenStreamException {
0307:                int _ttype;
0308:                Token _token = null;
0309:                int _begin = text.length();
0310:                _ttype = LBRACE;
0311:                match('{');
0312:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0313:                    _token = makeToken(_ttype);
0314:                    _token.setText(new String(text.getBuffer(), _begin, text
0315:                            .length()
0316:                            - _begin));
0317:                }
0318:                _returnToken = _token;
0319:            }
0320:
0321:            protected final void mRBRACE(boolean _createToken)
0322:                    throws RecognitionException, CharStreamException,
0323:                    TokenStreamException {
0324:                int _ttype;
0325:                Token _token = null;
0326:                int _begin = text.length();
0327:                _ttype = RBRACE;
0328:                match('}');
0329:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0330:                    _token = makeToken(_ttype);
0331:                    _token.setText(new String(text.getBuffer(), _begin, text
0332:                            .length()
0333:                            - _begin));
0334:                }
0335:                _returnToken = _token;
0336:            }
0337:
0338:            protected final void mPLUS(boolean _createToken)
0339:                    throws RecognitionException, CharStreamException,
0340:                    TokenStreamException {
0341:                int _ttype;
0342:                Token _token = null;
0343:                int _begin = text.length();
0344:                _ttype = PLUS;
0345:                match('+');
0346:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0347:                    _token = makeToken(_ttype);
0348:                    _token.setText(new String(text.getBuffer(), _begin, text
0349:                            .length()
0350:                            - _begin));
0351:                }
0352:                _returnToken = _token;
0353:            }
0354:
0355:            protected final void mSTAR(boolean _createToken)
0356:                    throws RecognitionException, CharStreamException,
0357:                    TokenStreamException {
0358:                int _ttype;
0359:                Token _token = null;
0360:                int _begin = text.length();
0361:                _ttype = STAR;
0362:                match('*');
0363:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0364:                    _token = makeToken(_ttype);
0365:                    _token.setText(new String(text.getBuffer(), _begin, text
0366:                            .length()
0367:                            - _begin));
0368:                }
0369:                _returnToken = _token;
0370:            }
0371:
0372:            protected final void mSLASH(boolean _createToken)
0373:                    throws RecognitionException, CharStreamException,
0374:                    TokenStreamException {
0375:                int _ttype;
0376:                Token _token = null;
0377:                int _begin = text.length();
0378:                _ttype = SLASH;
0379:                match('/');
0380:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0381:                    _token = makeToken(_ttype);
0382:                    _token.setText(new String(text.getBuffer(), _begin, text
0383:                            .length()
0384:                            - _begin));
0385:                }
0386:                _returnToken = _token;
0387:            }
0388:
0389:            protected final void mMINUS(boolean _createToken)
0390:                    throws RecognitionException, CharStreamException,
0391:                    TokenStreamException {
0392:                int _ttype;
0393:                Token _token = null;
0394:                int _begin = text.length();
0395:                _ttype = MINUS;
0396:                match('-');
0397:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0398:                    _token = makeToken(_ttype);
0399:                    _token.setText(new String(text.getBuffer(), _begin, text
0400:                            .length()
0401:                            - _begin));
0402:                }
0403:                _returnToken = _token;
0404:            }
0405:
0406:            protected final void mMATH_ATOM(boolean _createToken)
0407:                    throws RecognitionException, CharStreamException,
0408:                    TokenStreamException {
0409:                int _ttype;
0410:                Token _token = null;
0411:                int _begin = text.length();
0412:                _ttype = MATH_ATOM;
0413:                switch (LA(1)) {
0414:                case 'P': {
0415:                    mEMBEDDED_PROPERTY(false);
0416:                    break;
0417:                }
0418:                case 'M': {
0419:                    mEMBEDDED_MATH(false);
0420:                    break;
0421:                }
0422:                case '0':
0423:                case '1':
0424:                case '2':
0425:                case '3':
0426:                case '4':
0427:                case '5':
0428:                case '6':
0429:                case '7':
0430:                case '8':
0431:                case '9': {
0432:                    {
0433:                        int _cnt20 = 0;
0434:                        _loop20: do {
0435:                            if (((LA(1) >= '0' && LA(1) <= '9'))) {
0436:                                matchRange('0', '9');
0437:                            } else {
0438:                                if (_cnt20 >= 1) {
0439:                                    break _loop20;
0440:                                } else {
0441:                                    throw new NoViableAltForCharException(
0442:                                            (char) LA(1), getFilename(),
0443:                                            getLine(), getColumn());
0444:                                }
0445:                            }
0446:
0447:                            _cnt20++;
0448:                        } while (true);
0449:                    }
0450:                    break;
0451:                }
0452:                default:
0453:                    if ((LA(1) == 'I') && (LA(2) == 'F') && (LA(3) == '(')) {
0454:                        mEMBEDDED_CONDITION(false);
0455:                    } else if ((LA(1) == 'I') && (LA(2) == 'F')
0456:                            && (LA(3) == 'P')) {
0457:                        mEMBEDDED_PROPERTY_CONDITION(false);
0458:                    } else {
0459:                        throw new NoViableAltForCharException((char) LA(1),
0460:                                getFilename(), getLine(), getColumn());
0461:                    }
0462:                }
0463:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0464:                    _token = makeToken(_ttype);
0465:                    _token.setText(new String(text.getBuffer(), _begin, text
0466:                            .length()
0467:                            - _begin));
0468:                }
0469:                _returnToken = _token;
0470:            }
0471:
0472:            protected final void mEMBEDDED_PROPERTY(boolean _createToken)
0473:                    throws RecognitionException, CharStreamException,
0474:                    TokenStreamException {
0475:                int _ttype;
0476:                Token _token = null;
0477:                int _begin = text.length();
0478:                _ttype = EMBEDDED_PROPERTY;
0479:                Token name = null;
0480:                Token defaultValue = null;
0481:
0482:                match("PROPERTY");
0483:                mLPAREN(false);
0484:                mIDENTIFIER(true);
0485:                name = _returnToken;
0486:                {
0487:                    switch (LA(1)) {
0488:                    case ',': {
0489:                        mCOMMA(false);
0490:                        mATTRIBUTE_VALUE(true);
0491:                        defaultValue = _returnToken;
0492:                        break;
0493:                    }
0494:                    case ')': {
0495:                        break;
0496:                    }
0497:                    default: {
0498:                        throw new NoViableAltForCharException((char) LA(1),
0499:                                getFilename(), getLine(), getColumn());
0500:                    }
0501:                    }
0502:                }
0503:                mRPAREN(false);
0504:
0505:                String value = properties.getProperty(name.getText());
0506:                // if there is no property with this value, see if there is a default and use that
0507:                // instead
0508:                if ((value == null) && (defaultValue != null)) {
0509:                    value = defaultValue.getText();
0510:                }
0511:                // if there is no value at this stage, there is no hope for this property.
0512:                // set the text to the empty string
0513:                if (value == null) {
0514:                    text.setLength(_begin);
0515:                    text.append("");
0516:                } else {
0517:                    // set the property
0518:                    text.setLength(_begin);
0519:                    text.append(value);
0520:                }
0521:
0522:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0523:                    _token = makeToken(_ttype);
0524:                    _token.setText(new String(text.getBuffer(), _begin, text
0525:                            .length()
0526:                            - _begin));
0527:                }
0528:                _returnToken = _token;
0529:            }
0530:
0531:            protected final void mEMBEDDED_CONDITION(boolean _createToken)
0532:                    throws RecognitionException, CharStreamException,
0533:                    TokenStreamException {
0534:                int _ttype;
0535:                Token _token = null;
0536:                int _begin = text.length();
0537:                _ttype = EMBEDDED_CONDITION;
0538:                Token expression = null;
0539:                Token ifValue = null;
0540:                Token elseValue = null;
0541:
0542:                match("IF");
0543:                mLPAREN(false);
0544:                mCONDITION_EXPRESSION(true);
0545:                expression = _returnToken;
0546:                mRPAREN(false);
0547:                mLBRACE(false);
0548:                mCONDITIONAL_CONTENT(true);
0549:                ifValue = _returnToken;
0550:                mRBRACE(false);
0551:                {
0552:                    if ((LA(1) == '{')) {
0553:                        mLBRACE(false);
0554:                        mCONDITIONAL_CONTENT(true);
0555:                        elseValue = _returnToken;
0556:                        mRBRACE(false);
0557:                    } else {
0558:                    }
0559:
0560:                }
0561:
0562:                // see if the expression evaluates to true
0563:                if (expression.getText().equals("true")) {
0564:                    text.setLength(_begin);
0565:                    text.append(ifValue.getText());
0566:                } else if (elseValue != null) {
0567:                    // if an else was specified, use that
0568:                    text.setLength(_begin);
0569:                    text.append(elseValue.getText());
0570:                } else {
0571:                    // no hope for this condition
0572:                    text.setLength(_begin);
0573:                    text.append("");
0574:                }
0575:
0576:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0577:                    _token = makeToken(_ttype);
0578:                    _token.setText(new String(text.getBuffer(), _begin, text
0579:                            .length()
0580:                            - _begin));
0581:                }
0582:                _returnToken = _token;
0583:            }
0584:
0585:            protected final void mEMBEDDED_PROPERTY_CONDITION(
0586:                    boolean _createToken) throws RecognitionException,
0587:                    CharStreamException, TokenStreamException {
0588:                int _ttype;
0589:                Token _token = null;
0590:                int _begin = text.length();
0591:                _ttype = EMBEDDED_PROPERTY_CONDITION;
0592:                Token name = null;
0593:                Token ifValue = null;
0594:                Token elseValue = null;
0595:
0596:                match("IFPROPERTY");
0597:                mLPAREN(false);
0598:                mIDENTIFIER(true);
0599:                name = _returnToken;
0600:                mRPAREN(false);
0601:                mLBRACE(false);
0602:                mCONDITIONAL_CONTENT(true);
0603:                ifValue = _returnToken;
0604:                mRBRACE(false);
0605:                {
0606:                    if ((LA(1) == '{')) {
0607:                        mLBRACE(false);
0608:                        mCONDITIONAL_CONTENT(true);
0609:                        elseValue = _returnToken;
0610:                        mRBRACE(false);
0611:                    } else {
0612:                    }
0613:
0614:                }
0615:
0616:                // see if there is a property with this name, and it is not empty or
0617:                // zero
0618:                if (properties.getProperty(name.getText()) != null) {
0619:                    text.setLength(_begin);
0620:                    text.append(ifValue.getText());
0621:                } else if (elseValue != null) {
0622:                    // if an else was specified, use that
0623:                    text.setLength(_begin);
0624:                    text.append(elseValue.getText());
0625:                } else {
0626:                    // no hope for this condition
0627:                    text.setLength(_begin);
0628:                    text.append("");
0629:                }
0630:
0631:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0632:                    _token = makeToken(_ttype);
0633:                    _token.setText(new String(text.getBuffer(), _begin, text
0634:                            .length()
0635:                            - _begin));
0636:                }
0637:                _returnToken = _token;
0638:            }
0639:
0640:            protected final void mEMBEDDED_MATH(boolean _createToken)
0641:                    throws RecognitionException, CharStreamException,
0642:                    TokenStreamException {
0643:                int _ttype;
0644:                Token _token = null;
0645:                int _begin = text.length();
0646:                _ttype = EMBEDDED_MATH;
0647:                Token value = null;
0648:
0649:                match("MATH");
0650:                mLBRACE(false);
0651:                mADDITIVE_EXPRESSION(true);
0652:                value = _returnToken;
0653:                mRBRACE(false);
0654:
0655:                text.setLength(_begin);
0656:                text.append(value.getText());
0657:
0658:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0659:                    _token = makeToken(_ttype);
0660:                    _token.setText(new String(text.getBuffer(), _begin, text
0661:                            .length()
0662:                            - _begin));
0663:                }
0664:                _returnToken = _token;
0665:            }
0666:
0667:            protected final void mIDENTIFIER(boolean _createToken)
0668:                    throws RecognitionException, CharStreamException,
0669:                    TokenStreamException {
0670:                int _ttype;
0671:                Token _token = null;
0672:                int _begin = text.length();
0673:                _ttype = IDENTIFIER;
0674:                {
0675:                    switch (LA(1)) {
0676:                    case 'A':
0677:                    case 'B':
0678:                    case 'C':
0679:                    case 'D':
0680:                    case 'E':
0681:                    case 'F':
0682:                    case 'G':
0683:                    case 'H':
0684:                    case 'I':
0685:                    case 'J':
0686:                    case 'K':
0687:                    case 'L':
0688:                    case 'M':
0689:                    case 'N':
0690:                    case 'O':
0691:                    case 'P':
0692:                    case 'Q':
0693:                    case 'R':
0694:                    case 'S':
0695:                    case 'T':
0696:                    case 'U':
0697:                    case 'V':
0698:                    case 'W':
0699:                    case 'X':
0700:                    case 'Y':
0701:                    case 'Z':
0702:                    case 'a':
0703:                    case 'b':
0704:                    case 'c':
0705:                    case 'd':
0706:                    case 'e':
0707:                    case 'f':
0708:                    case 'g':
0709:                    case 'h':
0710:                    case 'i':
0711:                    case 'j':
0712:                    case 'k':
0713:                    case 'l':
0714:                    case 'm':
0715:                    case 'n':
0716:                    case 'o':
0717:                    case 'p':
0718:                    case 'q':
0719:                    case 'r':
0720:                    case 's':
0721:                    case 't':
0722:                    case 'u':
0723:                    case 'v':
0724:                    case 'w':
0725:                    case 'x':
0726:                    case 'y':
0727:                    case 'z': {
0728:                        {
0729:                            switch (LA(1)) {
0730:                            case 'a':
0731:                            case 'b':
0732:                            case 'c':
0733:                            case 'd':
0734:                            case 'e':
0735:                            case 'f':
0736:                            case 'g':
0737:                            case 'h':
0738:                            case 'i':
0739:                            case 'j':
0740:                            case 'k':
0741:                            case 'l':
0742:                            case 'm':
0743:                            case 'n':
0744:                            case 'o':
0745:                            case 'p':
0746:                            case 'q':
0747:                            case 'r':
0748:                            case 's':
0749:                            case 't':
0750:                            case 'u':
0751:                            case 'v':
0752:                            case 'w':
0753:                            case 'x':
0754:                            case 'y':
0755:                            case 'z': {
0756:                                matchRange('a', 'z');
0757:                                break;
0758:                            }
0759:                            case 'A':
0760:                            case 'B':
0761:                            case 'C':
0762:                            case 'D':
0763:                            case 'E':
0764:                            case 'F':
0765:                            case 'G':
0766:                            case 'H':
0767:                            case 'I':
0768:                            case 'J':
0769:                            case 'K':
0770:                            case 'L':
0771:                            case 'M':
0772:                            case 'N':
0773:                            case 'O':
0774:                            case 'P':
0775:                            case 'Q':
0776:                            case 'R':
0777:                            case 'S':
0778:                            case 'T':
0779:                            case 'U':
0780:                            case 'V':
0781:                            case 'W':
0782:                            case 'X':
0783:                            case 'Y':
0784:                            case 'Z': {
0785:                                matchRange('A', 'Z');
0786:                                break;
0787:                            }
0788:                            default: {
0789:                                throw new NoViableAltForCharException(
0790:                                        (char) LA(1), getFilename(), getLine(),
0791:                                        getColumn());
0792:                            }
0793:                            }
0794:                        }
0795:                        break;
0796:                    }
0797:                    case '.': {
0798:                        match('.');
0799:                        break;
0800:                    }
0801:                    default: {
0802:                        throw new NoViableAltForCharException((char) LA(1),
0803:                                getFilename(), getLine(), getColumn());
0804:                    }
0805:                    }
0806:                }
0807:                {
0808:                    _loop27: do {
0809:                        switch (LA(1)) {
0810:                        case 'A':
0811:                        case 'B':
0812:                        case 'C':
0813:                        case 'D':
0814:                        case 'E':
0815:                        case 'F':
0816:                        case 'G':
0817:                        case 'H':
0818:                        case 'I':
0819:                        case 'J':
0820:                        case 'K':
0821:                        case 'L':
0822:                        case 'M':
0823:                        case 'N':
0824:                        case 'O':
0825:                        case 'P':
0826:                        case 'Q':
0827:                        case 'R':
0828:                        case 'S':
0829:                        case 'T':
0830:                        case 'U':
0831:                        case 'V':
0832:                        case 'W':
0833:                        case 'X':
0834:                        case 'Y':
0835:                        case 'Z':
0836:                        case 'a':
0837:                        case 'b':
0838:                        case 'c':
0839:                        case 'd':
0840:                        case 'e':
0841:                        case 'f':
0842:                        case 'g':
0843:                        case 'h':
0844:                        case 'i':
0845:                        case 'j':
0846:                        case 'k':
0847:                        case 'l':
0848:                        case 'm':
0849:                        case 'n':
0850:                        case 'o':
0851:                        case 'p':
0852:                        case 'q':
0853:                        case 'r':
0854:                        case 's':
0855:                        case 't':
0856:                        case 'u':
0857:                        case 'v':
0858:                        case 'w':
0859:                        case 'x':
0860:                        case 'y':
0861:                        case 'z': {
0862:                            {
0863:                                switch (LA(1)) {
0864:                                case 'a':
0865:                                case 'b':
0866:                                case 'c':
0867:                                case 'd':
0868:                                case 'e':
0869:                                case 'f':
0870:                                case 'g':
0871:                                case 'h':
0872:                                case 'i':
0873:                                case 'j':
0874:                                case 'k':
0875:                                case 'l':
0876:                                case 'm':
0877:                                case 'n':
0878:                                case 'o':
0879:                                case 'p':
0880:                                case 'q':
0881:                                case 'r':
0882:                                case 's':
0883:                                case 't':
0884:                                case 'u':
0885:                                case 'v':
0886:                                case 'w':
0887:                                case 'x':
0888:                                case 'y':
0889:                                case 'z': {
0890:                                    matchRange('a', 'z');
0891:                                    break;
0892:                                }
0893:                                case 'A':
0894:                                case 'B':
0895:                                case 'C':
0896:                                case 'D':
0897:                                case 'E':
0898:                                case 'F':
0899:                                case 'G':
0900:                                case 'H':
0901:                                case 'I':
0902:                                case 'J':
0903:                                case 'K':
0904:                                case 'L':
0905:                                case 'M':
0906:                                case 'N':
0907:                                case 'O':
0908:                                case 'P':
0909:                                case 'Q':
0910:                                case 'R':
0911:                                case 'S':
0912:                                case 'T':
0913:                                case 'U':
0914:                                case 'V':
0915:                                case 'W':
0916:                                case 'X':
0917:                                case 'Y':
0918:                                case 'Z': {
0919:                                    matchRange('A', 'Z');
0920:                                    break;
0921:                                }
0922:                                default: {
0923:                                    throw new NoViableAltForCharException(
0924:                                            (char) LA(1), getFilename(),
0925:                                            getLine(), getColumn());
0926:                                }
0927:                                }
0928:                            }
0929:                            break;
0930:                        }
0931:                        case '0':
0932:                        case '1':
0933:                        case '2':
0934:                        case '3':
0935:                        case '4':
0936:                        case '5':
0937:                        case '6':
0938:                        case '7':
0939:                        case '8':
0940:                        case '9': {
0941:                            {
0942:                                matchRange('0', '9');
0943:                            }
0944:                            break;
0945:                        }
0946:                        case '.': {
0947:                            match('.');
0948:                            break;
0949:                        }
0950:                        default: {
0951:                            break _loop27;
0952:                        }
0953:                        }
0954:                    } while (true);
0955:                }
0956:                if (_createToken && _token == null && _ttype != Token.SKIP) {
0957:                    _token = makeToken(_ttype);
0958:                    _token.setText(new String(text.getBuffer(), _begin, text
0959:                            .length()
0960:                            - _begin));
0961:                }
0962:                _returnToken = _token;
0963:            }
0964:
0965:            protected final void mADDITIVE_EXPRESSION(boolean _createToken)
0966:                    throws RecognitionException, CharStreamException,
0967:                    TokenStreamException {
0968:                int _ttype;
0969:                Token _token = null;
0970:                int _begin = text.length();
0971:                _ttype = ADDITIVE_EXPRESSION;
0972:                Token first = null;
0973:                Token plusValue = null;
0974:                Token minusValue = null;
0975:                int total = 0;
0976:                String totalText;
0977:
0978:                mMULTIPLICATIVE_EXPRESSION(true);
0979:                first = _returnToken;
0980:
0981:                total = convertStringToInt(first.getText());
0982:
0983:                {
0984:                    _loop34: do {
0985:                        switch (LA(1)) {
0986:                        case '+': {
0987:                            {
0988:                                mPLUS(false);
0989:                                mMULTIPLICATIVE_EXPRESSION(true);
0990:                                plusValue = _returnToken;
0991:
0992:                                total += convertStringToInt(plusValue.getText());
0993:
0994:                            }
0995:                            break;
0996:                        }
0997:                        case '-': {
0998:                            {
0999:                                mMINUS(false);
1000:                                mMULTIPLICATIVE_EXPRESSION(true);
1001:                                minusValue = _returnToken;
1002:
1003:                                total -= convertStringToInt(minusValue
1004:                                        .getText());
1005:
1006:                            }
1007:                            break;
1008:                        }
1009:                        default: {
1010:                            break _loop34;
1011:                        }
1012:                        }
1013:                    } while (true);
1014:                }
1015:
1016:                totalText = new Integer(total).toString();
1017:                text.setLength(_begin);
1018:                text.append(totalText);
1019:
1020:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1021:                    _token = makeToken(_ttype);
1022:                    _token.setText(new String(text.getBuffer(), _begin, text
1023:                            .length()
1024:                            - _begin));
1025:                }
1026:                _returnToken = _token;
1027:            }
1028:
1029:            public final void mMATH(boolean _createToken)
1030:                    throws RecognitionException, CharStreamException,
1031:                    TokenStreamException {
1032:                int _ttype;
1033:                Token _token = null;
1034:                int _begin = text.length();
1035:                _ttype = MATH;
1036:                mEMBEDDED_MATH(false);
1037:
1038:                buffer.append(new String(text.getBuffer(), _begin, text
1039:                        .length()
1040:                        - _begin));
1041:
1042:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1043:                    _token = makeToken(_ttype);
1044:                    _token.setText(new String(text.getBuffer(), _begin, text
1045:                            .length()
1046:                            - _begin));
1047:                }
1048:                _returnToken = _token;
1049:            }
1050:
1051:            protected final void mMULTIPLICATIVE_EXPRESSION(boolean _createToken)
1052:                    throws RecognitionException, CharStreamException,
1053:                    TokenStreamException {
1054:                int _ttype;
1055:                Token _token = null;
1056:                int _begin = text.length();
1057:                _ttype = MULTIPLICATIVE_EXPRESSION;
1058:                Token first = null;
1059:                Token mulipliedValue = null;
1060:                Token dividedValue = null;
1061:                int total = 0;
1062:                String totalText;
1063:
1064:                mMATH_ATOM(true);
1065:                first = _returnToken;
1066:
1067:                total = convertStringToInt(first.getText());
1068:
1069:                {
1070:                    _loop39: do {
1071:                        switch (LA(1)) {
1072:                        case '*': {
1073:                            {
1074:                                mSTAR(false);
1075:                                mMATH_ATOM(true);
1076:                                mulipliedValue = _returnToken;
1077:
1078:                                total *= convertStringToInt(mulipliedValue
1079:                                        .getText());
1080:
1081:                            }
1082:                            break;
1083:                        }
1084:                        case '/': {
1085:                            {
1086:                                mSLASH(false);
1087:                                mMATH_ATOM(true);
1088:                                dividedValue = _returnToken;
1089:
1090:                                total /= convertStringToInt(dividedValue
1091:                                        .getText());
1092:
1093:                            }
1094:                            break;
1095:                        }
1096:                        default: {
1097:                            break _loop39;
1098:                        }
1099:                        }
1100:                    } while (true);
1101:                }
1102:
1103:                totalText = new Integer(total).toString();
1104:                text.setLength(_begin);
1105:                text.append(totalText);
1106:
1107:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1108:                    _token = makeToken(_ttype);
1109:                    _token.setText(new String(text.getBuffer(), _begin, text
1110:                            .length()
1111:                            - _begin));
1112:                }
1113:                _returnToken = _token;
1114:            }
1115:
1116:            protected final void mWS(boolean _createToken)
1117:                    throws RecognitionException, CharStreamException,
1118:                    TokenStreamException {
1119:                int _ttype;
1120:                Token _token = null;
1121:                int _begin = text.length();
1122:                _ttype = WS;
1123:                {
1124:                    int _cnt42 = 0;
1125:                    _loop42: do {
1126:                        if ((LA(1) == '\r') && (LA(2) == '\n')
1127:                                && (_tokenSet_0.member(LA(3))) && (true)) {
1128:                            match("\r\n");
1129:                            newline();
1130:                        } else if ((LA(1) == ' ')
1131:                                && (_tokenSet_0.member(LA(2))) && (true)
1132:                                && (true)) {
1133:                            match(' ');
1134:                        } else if ((LA(1) == '\t')
1135:                                && (_tokenSet_0.member(LA(2))) && (true)
1136:                                && (true)) {
1137:                            match('\t');
1138:                        } else if ((LA(1) == '\n')
1139:                                && (_tokenSet_0.member(LA(2))) && (true)
1140:                                && (true)) {
1141:                            match('\n');
1142:                            newline();
1143:                        } else if ((LA(1) == '\r')
1144:                                && (_tokenSet_0.member(LA(2))) && (true)
1145:                                && (true)) {
1146:                            match('\r');
1147:                            newline();
1148:                        } else {
1149:                            if (_cnt42 >= 1) {
1150:                                break _loop42;
1151:                            } else {
1152:                                throw new NoViableAltForCharException(
1153:                                        (char) LA(1), getFilename(), getLine(),
1154:                                        getColumn());
1155:                            }
1156:                        }
1157:
1158:                        _cnt42++;
1159:                    } while (true);
1160:                }
1161:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1162:                    _token = makeToken(_ttype);
1163:                    _token.setText(new String(text.getBuffer(), _begin, text
1164:                            .length()
1165:                            - _begin));
1166:                }
1167:                _returnToken = _token;
1168:            }
1169:
1170:            protected final void mCONDITIONAL_CONTENT(boolean _createToken)
1171:                    throws RecognitionException, CharStreamException,
1172:                    TokenStreamException {
1173:                int _ttype;
1174:                Token _token = null;
1175:                int _begin = text.length();
1176:                _ttype = CONDITIONAL_CONTENT;
1177:                {
1178:                    _loop46: do {
1179:                        if ((LA(1) == 'A') && (LA(2) == 'T') && (LA(3) == 'T')
1180:                                && (LA(4) == 'R')) {
1181:                            mEMBEDDED_ATTRIBUTE(false);
1182:                        } else if ((LA(1) == 'I') && (LA(2) == 'F')
1183:                                && (LA(3) == '(')
1184:                                && (_tokenSet_1.member(LA(4)))) {
1185:                            mEMBEDDED_CONDITION(false);
1186:                        } else if ((LA(1) == 'I') && (LA(2) == 'F')
1187:                                && (LA(3) == 'P') && (LA(4) == 'R')) {
1188:                            mEMBEDDED_PROPERTY_CONDITION(false);
1189:                        } else if ((LA(1) == 'P') && (LA(2) == 'R')
1190:                                && (LA(3) == 'O') && (LA(4) == 'P')) {
1191:                            mEMBEDDED_PROPERTY(false);
1192:                        } else if ((LA(1) == 'M') && (LA(2) == 'A')
1193:                                && (LA(3) == 'T') && (LA(4) == 'H')) {
1194:                            mEMBEDDED_MATH(false);
1195:                        } else if ((_tokenSet_2.member(LA(1)))
1196:                                && (_tokenSet_0.member(LA(2))) && (true)
1197:                                && (true)) {
1198:                            mWS(false);
1199:                        } else if ((_tokenSet_3.member(LA(1)))
1200:                                && (_tokenSet_0.member(LA(2))) && (true)
1201:                                && (true)) {
1202:                            {
1203:                                match(_tokenSet_3);
1204:                            }
1205:                        } else {
1206:                            break _loop46;
1207:                        }
1208:
1209:                    } while (true);
1210:                }
1211:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1212:                    _token = makeToken(_ttype);
1213:                    _token.setText(new String(text.getBuffer(), _begin, text
1214:                            .length()
1215:                            - _begin));
1216:                }
1217:                _returnToken = _token;
1218:            }
1219:
1220:            protected final void mEMBEDDED_ATTRIBUTE(boolean _createToken)
1221:                    throws RecognitionException, CharStreamException,
1222:                    TokenStreamException {
1223:                int _ttype;
1224:                Token _token = null;
1225:                int _begin = text.length();
1226:                _ttype = EMBEDDED_ATTRIBUTE;
1227:                Token name = null;
1228:                Token attributeName = null;
1229:                Token defaultValue = null;
1230:
1231:                match("ATTRIBUTE");
1232:                mLPAREN(false);
1233:                mIDENTIFIER(true);
1234:                name = _returnToken;
1235:                {
1236:                    switch (LA(1)) {
1237:                    case ':': {
1238:                        mCOLON(false);
1239:                        mIDENTIFIER(true);
1240:                        attributeName = _returnToken;
1241:                        break;
1242:                    }
1243:                    case ')':
1244:                    case ',': {
1245:                        break;
1246:                    }
1247:                    default: {
1248:                        throw new NoViableAltForCharException((char) LA(1),
1249:                                getFilename(), getLine(), getColumn());
1250:                    }
1251:                    }
1252:                }
1253:                {
1254:                    switch (LA(1)) {
1255:                    case ',': {
1256:                        mCOMMA(false);
1257:                        mATTRIBUTE_VALUE(true);
1258:                        defaultValue = _returnToken;
1259:                        break;
1260:                    }
1261:                    case ')': {
1262:                        break;
1263:                    }
1264:                    default: {
1265:                        throw new NoViableAltForCharException((char) LA(1),
1266:                                getFilename(), getLine(), getColumn());
1267:                    }
1268:                    }
1269:                }
1270:                mRPAREN(false);
1271:
1272:                // if you didn't give us an attribute name, make it the same as the name
1273:                if (attributeName == null) {
1274:                    attributeName = name;
1275:                }
1276:                String value = properties.getProperty(name.getText());
1277:                // if there is no property with this value, see if there is a default and use that
1278:                // instead
1279:                if ((value == null) && (defaultValue != null)) {
1280:                    value = defaultValue.getText();
1281:                }
1282:                // if there is no value at this stage, there is no hope for this attribute.
1283:                // set the text to the empty string
1284:                if (value == null) {
1285:                    text.setLength(_begin);
1286:                    text.append("");
1287:                } else {
1288:                    // set the attribute
1289:                    text.setLength(_begin);
1290:                    text.append(attributeName.getText() + "='" + value + "'");
1291:                }
1292:
1293:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1294:                    _token = makeToken(_ttype);
1295:                    _token.setText(new String(text.getBuffer(), _begin, text
1296:                            .length()
1297:                            - _begin));
1298:                }
1299:                _returnToken = _token;
1300:            }
1301:
1302:            protected final void mCONDITION_EXPRESSION(boolean _createToken)
1303:                    throws RecognitionException, CharStreamException,
1304:                    TokenStreamException {
1305:                int _ttype;
1306:                Token _token = null;
1307:                int _begin = text.length();
1308:                _ttype = CONDITION_EXPRESSION;
1309:                Token first = null;
1310:                Token equals = null;
1311:                Token less = null;
1312:                Token lessEquals = null;
1313:                Token greater = null;
1314:                Token greaterEquals = null;
1315:
1316:                mCONDITION_ATOM(true);
1317:                first = _returnToken;
1318:                {
1319:                    if ((LA(1) == '<') && (_tokenSet_1.member(LA(2)))) {
1320:                        {
1321:                            mLESS(false);
1322:                            mCONDITION_ATOM(true);
1323:                            less = _returnToken;
1324:
1325:                            if (convertStringToInt(first.getText()) < convertStringToInt(less
1326:                                    .getText())) {
1327:                                text.setLength(_begin);
1328:                                text.append("true");
1329:                            } else {
1330:                                text.setLength(_begin);
1331:                                text.append("false");
1332:                            }
1333:
1334:                        }
1335:                    } else if ((LA(1) == '<') && (LA(2) == '=')) {
1336:                        {
1337:                            mLESS_EQUALS(false);
1338:                            mCONDITION_ATOM(true);
1339:                            lessEquals = _returnToken;
1340:
1341:                            if (convertStringToInt(first.getText()) <= convertStringToInt(lessEquals
1342:                                    .getText())) {
1343:                                text.setLength(_begin);
1344:                                text.append("true");
1345:                            } else {
1346:                                text.setLength(_begin);
1347:                                text.append("false");
1348:                            }
1349:
1350:                        }
1351:                    } else if ((LA(1) == '>') && (_tokenSet_1.member(LA(2)))) {
1352:                        {
1353:                            mGREATER(false);
1354:                            mCONDITION_ATOM(true);
1355:                            greater = _returnToken;
1356:
1357:                            if (convertStringToInt(first.getText()) > convertStringToInt(greater
1358:                                    .getText())) {
1359:                                text.setLength(_begin);
1360:                                text.append("true");
1361:                            } else {
1362:                                text.setLength(_begin);
1363:                                text.append("false");
1364:                            }
1365:
1366:                        }
1367:                    } else if ((LA(1) == '>') && (LA(2) == '=')) {
1368:                        {
1369:                            mGREATER_EQUALS(false);
1370:                            mCONDITION_ATOM(true);
1371:                            greaterEquals = _returnToken;
1372:
1373:                            if (convertStringToInt(first.getText()) >= convertStringToInt(greaterEquals
1374:                                    .getText())) {
1375:                                text.setLength(_begin);
1376:                                text.append("true");
1377:                            } else {
1378:                                text.setLength(_begin);
1379:                                text.append("false");
1380:                            }
1381:
1382:                        }
1383:                    } else if ((LA(1) == '=')) {
1384:                        {
1385:                            mEQUALS(false);
1386:                            mCONDITION_ATOM(true);
1387:                            equals = _returnToken;
1388:
1389:                            if (convertStringToInt(first.getText()) == convertStringToInt(equals
1390:                                    .getText())) {
1391:                                text.setLength(_begin);
1392:                                text.append("true");
1393:                            } else {
1394:                                text.setLength(_begin);
1395:                                text.append("false");
1396:                            }
1397:
1398:                        }
1399:                    } else {
1400:                        throw new NoViableAltForCharException((char) LA(1),
1401:                                getFilename(), getLine(), getColumn());
1402:                    }
1403:
1404:                }
1405:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1406:                    _token = makeToken(_ttype);
1407:                    _token.setText(new String(text.getBuffer(), _begin, text
1408:                            .length()
1409:                            - _begin));
1410:                }
1411:                _returnToken = _token;
1412:            }
1413:
1414:            protected final void mCONDITION_ATOM(boolean _createToken)
1415:                    throws RecognitionException, CharStreamException,
1416:                    TokenStreamException {
1417:                int _ttype;
1418:                Token _token = null;
1419:                int _begin = text.length();
1420:                _ttype = CONDITION_ATOM;
1421:                switch (LA(1)) {
1422:                case 'P': {
1423:                    mEMBEDDED_PROPERTY(false);
1424:                    break;
1425:                }
1426:                case 'M': {
1427:                    mEMBEDDED_MATH(false);
1428:                    break;
1429:                }
1430:                case '0':
1431:                case '1':
1432:                case '2':
1433:                case '3':
1434:                case '4':
1435:                case '5':
1436:                case '6':
1437:                case '7':
1438:                case '8':
1439:                case '9': {
1440:                    {
1441:                        int _cnt53 = 0;
1442:                        _loop53: do {
1443:                            if (((LA(1) >= '0' && LA(1) <= '9'))) {
1444:                                matchRange('0', '9');
1445:                            } else {
1446:                                if (_cnt53 >= 1) {
1447:                                    break _loop53;
1448:                                } else {
1449:                                    throw new NoViableAltForCharException(
1450:                                            (char) LA(1), getFilename(),
1451:                                            getLine(), getColumn());
1452:                                }
1453:                            }
1454:
1455:                            _cnt53++;
1456:                        } while (true);
1457:                    }
1458:                    break;
1459:                }
1460:                default:
1461:                    if ((LA(1) == 'I') && (LA(2) == 'F') && (LA(3) == '(')) {
1462:                        mEMBEDDED_CONDITION(false);
1463:                    } else if ((LA(1) == 'I') && (LA(2) == 'F')
1464:                            && (LA(3) == 'P')) {
1465:                        mEMBEDDED_PROPERTY_CONDITION(false);
1466:                    } else {
1467:                        throw new NoViableAltForCharException((char) LA(1),
1468:                                getFilename(), getLine(), getColumn());
1469:                    }
1470:                }
1471:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1472:                    _token = makeToken(_ttype);
1473:                    _token.setText(new String(text.getBuffer(), _begin, text
1474:                            .length()
1475:                            - _begin));
1476:                }
1477:                _returnToken = _token;
1478:            }
1479:
1480:            protected final void mEQUALS(boolean _createToken)
1481:                    throws RecognitionException, CharStreamException,
1482:                    TokenStreamException {
1483:                int _ttype;
1484:                Token _token = null;
1485:                int _begin = text.length();
1486:                _ttype = EQUALS;
1487:                match("==");
1488:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1489:                    _token = makeToken(_ttype);
1490:                    _token.setText(new String(text.getBuffer(), _begin, text
1491:                            .length()
1492:                            - _begin));
1493:                }
1494:                _returnToken = _token;
1495:            }
1496:
1497:            protected final void mLESS(boolean _createToken)
1498:                    throws RecognitionException, CharStreamException,
1499:                    TokenStreamException {
1500:                int _ttype;
1501:                Token _token = null;
1502:                int _begin = text.length();
1503:                _ttype = LESS;
1504:                match('<');
1505:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1506:                    _token = makeToken(_ttype);
1507:                    _token.setText(new String(text.getBuffer(), _begin, text
1508:                            .length()
1509:                            - _begin));
1510:                }
1511:                _returnToken = _token;
1512:            }
1513:
1514:            protected final void mLESS_EQUALS(boolean _createToken)
1515:                    throws RecognitionException, CharStreamException,
1516:                    TokenStreamException {
1517:                int _ttype;
1518:                Token _token = null;
1519:                int _begin = text.length();
1520:                _ttype = LESS_EQUALS;
1521:                match("<=");
1522:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1523:                    _token = makeToken(_ttype);
1524:                    _token.setText(new String(text.getBuffer(), _begin, text
1525:                            .length()
1526:                            - _begin));
1527:                }
1528:                _returnToken = _token;
1529:            }
1530:
1531:            protected final void mGREATER(boolean _createToken)
1532:                    throws RecognitionException, CharStreamException,
1533:                    TokenStreamException {
1534:                int _ttype;
1535:                Token _token = null;
1536:                int _begin = text.length();
1537:                _ttype = GREATER;
1538:                match('>');
1539:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1540:                    _token = makeToken(_ttype);
1541:                    _token.setText(new String(text.getBuffer(), _begin, text
1542:                            .length()
1543:                            - _begin));
1544:                }
1545:                _returnToken = _token;
1546:            }
1547:
1548:            protected final void mGREATER_EQUALS(boolean _createToken)
1549:                    throws RecognitionException, CharStreamException,
1550:                    TokenStreamException {
1551:                int _ttype;
1552:                Token _token = null;
1553:                int _begin = text.length();
1554:                _ttype = GREATER_EQUALS;
1555:                match(">=");
1556:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1557:                    _token = makeToken(_ttype);
1558:                    _token.setText(new String(text.getBuffer(), _begin, text
1559:                            .length()
1560:                            - _begin));
1561:                }
1562:                _returnToken = _token;
1563:            }
1564:
1565:            public final void mCONDITION(boolean _createToken)
1566:                    throws RecognitionException, CharStreamException,
1567:                    TokenStreamException {
1568:                int _ttype;
1569:                Token _token = null;
1570:                int _begin = text.length();
1571:                _ttype = CONDITION;
1572:                {
1573:                    if ((LA(1) == 'I') && (LA(2) == 'F') && (LA(3) == '(')) {
1574:                        mEMBEDDED_CONDITION(false);
1575:                    } else if ((LA(1) == 'I') && (LA(2) == 'F')
1576:                            && (LA(3) == 'P')) {
1577:                        mEMBEDDED_PROPERTY_CONDITION(false);
1578:                    } else {
1579:                        throw new NoViableAltForCharException((char) LA(1),
1580:                                getFilename(), getLine(), getColumn());
1581:                    }
1582:
1583:                }
1584:
1585:                buffer.append(new String(text.getBuffer(), _begin, text
1586:                        .length()
1587:                        - _begin));
1588:
1589:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1590:                    _token = makeToken(_ttype);
1591:                    _token.setText(new String(text.getBuffer(), _begin, text
1592:                            .length()
1593:                            - _begin));
1594:                }
1595:                _returnToken = _token;
1596:            }
1597:
1598:            protected final void mATTRIBUTE_VALUE(boolean _createToken)
1599:                    throws RecognitionException, CharStreamException,
1600:                    TokenStreamException {
1601:                int _ttype;
1602:                Token _token = null;
1603:                int _begin = text.length();
1604:                _ttype = ATTRIBUTE_VALUE;
1605:                {
1606:                    int _cnt71 = 0;
1607:                    _loop71: do {
1608:                        if ((_tokenSet_4.member(LA(1)))) {
1609:                            {
1610:                                match(_tokenSet_4);
1611:                            }
1612:                        } else {
1613:                            if (_cnt71 >= 1) {
1614:                                break _loop71;
1615:                            } else {
1616:                                throw new NoViableAltForCharException(
1617:                                        (char) LA(1), getFilename(), getLine(),
1618:                                        getColumn());
1619:                            }
1620:                        }
1621:
1622:                        _cnt71++;
1623:                    } while (true);
1624:                }
1625:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1626:                    _token = makeToken(_ttype);
1627:                    _token.setText(new String(text.getBuffer(), _begin, text
1628:                            .length()
1629:                            - _begin));
1630:                }
1631:                _returnToken = _token;
1632:            }
1633:
1634:            public final void mATTRIBUTE(boolean _createToken)
1635:                    throws RecognitionException, CharStreamException,
1636:                    TokenStreamException {
1637:                int _ttype;
1638:                Token _token = null;
1639:                int _begin = text.length();
1640:                _ttype = ATTRIBUTE;
1641:                mEMBEDDED_ATTRIBUTE(false);
1642:
1643:                buffer.append(new String(text.getBuffer(), _begin, text
1644:                        .length()
1645:                        - _begin));
1646:
1647:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1648:                    _token = makeToken(_ttype);
1649:                    _token.setText(new String(text.getBuffer(), _begin, text
1650:                            .length()
1651:                            - _begin));
1652:                }
1653:                _returnToken = _token;
1654:            }
1655:
1656:            public final void mPROPERTY(boolean _createToken)
1657:                    throws RecognitionException, CharStreamException,
1658:                    TokenStreamException {
1659:                int _ttype;
1660:                Token _token = null;
1661:                int _begin = text.length();
1662:                _ttype = PROPERTY;
1663:                mEMBEDDED_PROPERTY(false);
1664:
1665:                buffer.append(new String(text.getBuffer(), _begin, text
1666:                        .length()
1667:                        - _begin));
1668:
1669:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1670:                    _token = makeToken(_ttype);
1671:                    _token.setText(new String(text.getBuffer(), _begin, text
1672:                            .length()
1673:                            - _begin));
1674:                }
1675:                _returnToken = _token;
1676:            }
1677:
1678:            protected final void mIGNORE(boolean _createToken)
1679:                    throws RecognitionException, CharStreamException,
1680:                    TokenStreamException {
1681:                int _ttype;
1682:                Token _token = null;
1683:                int _begin = text.length();
1684:                _ttype = IGNORE;
1685:                char c = '\0';
1686:
1687:                c = LA(1);
1688:                matchNot(EOF_CHAR);
1689:                buffer.append(c);
1690:                if (_createToken && _token == null && _ttype != Token.SKIP) {
1691:                    _token = makeToken(_ttype);
1692:                    _token.setText(new String(text.getBuffer(), _begin, text
1693:                            .length()
1694:                            - _begin));
1695:                }
1696:                _returnToken = _token;
1697:            }
1698:
1699:            private static final long[] mk_tokenSet_0() {
1700:                long[] data = new long[8];
1701:                data[0] = -8L;
1702:                data[1] = -576460752303423489L;
1703:                for (int i = 2; i <= 3; i++) {
1704:                    data[i] = -1L;
1705:                }
1706:                return data;
1707:            }
1708:
1709:            public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
1710:
1711:            private static final long[] mk_tokenSet_1() {
1712:                long[] data = { 287948901175001088L, 74240L, 0L, 0L, 0L };
1713:                return data;
1714:            }
1715:
1716:            public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
1717:
1718:            private static final long[] mk_tokenSet_2() {
1719:                long[] data = { 4294977024L, 0L, 0L, 0L, 0L };
1720:                return data;
1721:            }
1722:
1723:            public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
1724:
1725:            private static final long[] mk_tokenSet_3() {
1726:                long[] data = new long[8];
1727:                data[0] = -8L;
1728:                data[1] = -2882303761517117441L;
1729:                for (int i = 2; i <= 3; i++) {
1730:                    data[i] = -1L;
1731:                }
1732:                return data;
1733:            }
1734:
1735:            public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
1736:
1737:            private static final long[] mk_tokenSet_4() {
1738:                long[] data = new long[8];
1739:                data[0] = -2199023255560L;
1740:                for (int i = 1; i <= 3; i++) {
1741:                    data[i] = -1L;
1742:                }
1743:                return data;
1744:            }
1745:
1746:            public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
1747:
1748:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.