org.netbeans.modules.css.parser.css.jj Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of css-parser Show documentation
Show all versions of css-parser Show documentation
A CSS Parser extract from the NetBeans CSS modules
The newest version!
/*@bgen(jjtree) Generated By:JJTree: Do not edit this line. /Volumes/Mercurial/hg/web-main/css.editor/src/org/netbeans/modules/css/parser/css.jj */
/*@egen*/options {
IGNORE_CASE = true;
STATIC = false;
// UNICODE_INPUT = false;
USER_CHAR_STREAM = true;
}
PARSER_BEGIN(CssParser)
package org.netbeans.modules.css.parser;
import java.util.*;
public class CssParser/*@bgen(jjtree)*/implements CssParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/
protected JJTCssParserState jjtree = new JJTCssParserState();
/*@egen*/
private ArrayList errors = new ArrayList();
public CssParser() {
this((CharStream) null);
// change manager to our patched one:
token_source = new PatchedCssParserTokenManager(null);
}
public List errors() {
return errors;
}
}
PARSER_END(CssParser)
//TOKEN_MGR_DECLS :
TOKEN :
{
< S: ( " "|"\t"|"\r"|"\n"|"\f" )+ >
}
MORE :
{
< "/*" > : IN_COMMENT
}
MORE :
{
< ~[] >
}
TOKEN :
{
< COMMENT: "*/" > : DEFAULT
}
MORE:
{
< "expression(" > : MS_EXPRESSION
}
TOKEN :
{
//this is very simple identification of the end of the expression. The closing par. may be
//in a string or there might be some brackets in expressions inside.
< MSE : ")" > : DEFAULT
}
MORE :
{
< ~[] > : MS_EXPRESSION
}
TOKEN :
{
< LBRACE: "{" >
| < RBRACE: "}" >
| < COMMA: "," >
| < DOT: "." >
| < SEMICOLON: ";" >
| < COLON: ":" >
| < ASTERISK: "*" >
| < SLASH: "/" >
| < PLUS: "+" >
| < MINUS: "-" >
| < EQUALS: "=" >
| < GT: ">" >
| < LSQUARE: "[" >
| < RSQUARE: "]" >
}
TOKEN :
{
< HASH: "#" >
}
TOKEN :
{
< STRING: | >
| < RROUND: ")" >
}
TOKEN :
{
< #URL: ["!","#","$","%","&","*"-"~"] | | >
| < URI: "url(" ( )* ( | ( )* ) ( )* >
}
TOKEN : {
< GENERATED: "@@@" >
}
TOKEN :
{
< CDO: "" >
| < INCLUDES: "~=" >
| < CSS3_BEGINS: "^=" >
| < CSS3_ENDS: "$=" >
| < CSS3_CONTAINS: "*=" >
| < DASHMATCH: "|=" >
| < IMPORT_SYM: "@import" >
| < PAGE_SYM: "@page" >
| < MEDIA_SYM: "@media" >
| < FONT_FACE_SYM: "@font-face" >
| < CHARSET_SYM: "@charset" >
| < ATKEYWORD: "@" >
| < IMPORTANT_SYM: "!" ( )? "important" >
| < INHERIT: "inherit" >
| < EMS: "em" >
| < EXS: "ex" >
| < LENGTH_PX: "px" >
| < LENGTH_CM: "cm" >
| < LENGTH_MM: "mm" >
| < LENGTH_IN: "in" >
| < LENGTH_PT: "pt" >
| < LENGTH_PC: "pc" >
| < ANGLE_DEG: "deg" >
| < ANGLE_RAD: "rad" >
| < ANGLE_GRAD: "grad" >
| < TIME_MS: "ms" >
| < TIME_S: "s" >
| < FREQ_HZ: "Hz" >
| < FREQ_KHZ: "kHz" >
| < DIMEN: >
| < PERCENTAGE: "%" >
| < NUMBER: >
| < RGB: "rgb(" >
| < FUNCTION: "(" >
| < IDENT: ()+ | (( "-" )? ( )*) >
| < #NAME: ( )+ >
| < NUM: ( ["0"-"9"] )+ | ( ["0"-"9"] )* "." ( ["0"-"9"] )+ >
| < UNICODERANGE: "U+" ( | ( "-" ) ) >
| < #RANGE: | ( ()? | ( ()? | ( ()? | ( ()? | ( ()? | ) ) ) ) ) >
| < #Q16: "?" | "??" | "???" | "????" | "?????" | "??????" >
| < #Q15: "?" | "??" | "???" | "????" | "?????" >
| < #Q14: "?" | "??" | "???" | "????" >
| < #Q13: "?" | "??" | "???" >
| < #Q12: "?" | "??" >
| < #Q11: "?" >
| < #NMSTART: ["_"] | ["a"-"z"] | | >
| < #NMCHAR: ["_"] | ["a"-"z","0"-"9","-"] | | >
| < #STRING1: "\"" ( ["\t"," ","!","#","$","%","&","("-"~"] | "\\" | "\'" | | )* "\"" >
| < #STRING2: "\'" ( ["\t"," ","!","#","$","%","&","("-"~"] | "\\" | "\"" | | )* "\'" >
| < #NONASCII: ["\u0080"-"\uffff"] >
| < #ESCAPE: | ( "\\" [" "-"~","\u0080"-"\uffff"] ) >
| < #NL: "\n" | "\r\n" | "\r" | "\f" >
| < #UNICODE: "\\" ( " " | "\t" | "\r" | "\n" | "\f" )? >
| < #HNUM: | | | | | >
| < #H: ["0"-"9","a"-"f"] >
}
<*> TOKEN:
{
< UNKNOWN: ~[] >
{
//System.err.println("Illegal character : " + image.toString());
}
}
SimpleNode styleSheet() :{/*@bgen(jjtree) styleSheet */
SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEET);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) styleSheet */
try {
/*@egen*/
styleSheetRuleList()/*@bgen(jjtree)*/
{
jjtree.closeNodeScope(jjtn000, true);
jjtc000 = false;
jjtn000.jjtSetLastToken(getToken(0));
}
/*@egen*/
{ return jjtn000; }/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void styleSheetRuleList() :{/*@bgen(jjtree) styleSheetRuleList */
SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEETRULELIST);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) styleSheetRuleList */
try {
/*@egen*/
( charsetRule() )?
( ( | ) | | )*
( importRule() ( ( | ) | | )* )*
( ( { return; } | rule() ) ( ( | ) | | )* )*/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void rule() :{/*@bgen(jjtree) rule */
SimpleNode jjtn000 = new SimpleNode(JJTRULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) rule */
try {
/*@egen*/
styleRule() | mediaRule() | pageRule() | fontFaceRule() | unknownRule() | error_skip_to_whitespace()/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// This is used by ASTStyleSheet.insertRule to parse a single rule
//
void styleSheetRuleSingle() :{/*@bgen(jjtree) styleSheetRuleSingle */
SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEETRULESINGLE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) styleSheetRuleSingle */
try {
/*@egen*/
( charsetRule() | importRule() | styleRule() | mediaRule() | pageRule() | fontFaceRule() | unknownRule() )/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void charsetRule() : {/*@bgen(jjtree) charsetRule */
SimpleNode jjtn000 = new SimpleNode(JJTCHARSETRULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) charsetRule */
try {
/*@egen*/
( ( | ) )*
( ( | ) )*
/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void unknownRule() :{/*@bgen(jjtree) unknownRule */
SimpleNode jjtn000 = new SimpleNode(JJTUNKNOWNRULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) unknownRule */
try {
/*@egen*/
skip()/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void importRule() : {/*@bgen(jjtree) importRule */
SimpleNode jjtn000 = new SimpleNode(JJTIMPORTRULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) importRule */
try {
/*@egen*/
( ( | ) )*
(
| ) ( ( | ) )*
( mediaList() )?
/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void mediaRule() : {/*@bgen(jjtree) mediaRule */
SimpleNode jjtn000 = new SimpleNode(JJTMEDIARULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) mediaRule */
try {
/*@egen*/
try {
( ( | ) )*
mediaList()
( ( | ) )*
( mediaRuleList() )?
} catch(ParseException e) {
reportError(e);
error_skipblock();
}/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void mediaList() :{/*@bgen(jjtree) mediaList */
SimpleNode jjtn000 = new SimpleNode(JJTMEDIALIST);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) mediaList */
try {
/*@egen*/
medium()
( ( ( | ) )* medium() )*/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void mediaRuleList() : {/*@bgen(jjtree) mediaRuleList */
SimpleNode jjtn000 = new SimpleNode(JJTMEDIARULELIST);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/} {/*@bgen(jjtree) mediaRuleList */
try {
/*@egen*/
( ( styleRule() | pageRule() | unknownRule() ) ( ( | ) )* )+/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void mediaRuleSingle() :
{/*@bgen(jjtree) mediaRuleSingle */
SimpleNode jjtn000 = new SimpleNode(JJTMEDIARULESINGLE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) mediaRuleSingle */
try {
/*@egen*/
( styleRule() | pageRule() | unknownRule() )/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void medium() :
{/*@bgen(jjtree) medium */
SimpleNode jjtn000 = new SimpleNode(JJTMEDIUM);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) medium */
try {
/*@egen*/
( | ) ( ( | ) )*/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void pageRule() :
{/*@bgen(jjtree) pageRule */
SimpleNode jjtn000 = new SimpleNode(JJTPAGERULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
Token t = null;
String s = null;
boolean start = false;
}
{/*@bgen(jjtree) pageRule */
try {
/*@egen*/
( ( | ) )*
( LOOKAHEAD(2) ( t = ( ( | ) )* ) |
( pseudoPage() ( ( | ) )* ) |
( pseudoPage() ( ( | ) )* ) )?
( ( | ) )*
( declaration() )?
( ( ( | ) )* ( declaration() )? )*
/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// pseudoPage
// : ':' IDENT
// ;
//
void pseudoPage() :
{/*@bgen(jjtree) pseudoPage */
SimpleNode jjtn000 = new SimpleNode(JJTPSEUDOPAGE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) pseudoPage */
try {
/*@egen*/
/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// font_face
// : FONT_FACE_SYM S*
// '{' S* declaration [ ';' S* declaration ]* '}' S*
// ;
//
void fontFaceRule() :
{/*@bgen(jjtree) fontFaceRule */
SimpleNode jjtn000 = new SimpleNode(JJTFONTFACERULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) fontFaceRule */
try {
/*@egen*/
( ( | ) )*
( ( | ) )*
( declaration() )?
( ( ( | ) )* ( declaration() )? )*
/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// operator
// : '/' S* | ',' S* |
// ;
//
void operator() :
{/*@bgen(jjtree) operator */
SimpleNode jjtn000 = new SimpleNode(JJTOPERATOR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) operator */
try {
/*@egen*/
( ( | ) )* | ( ( | ) )*/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// combinator
// : '+' S* | '>' S* |
// ;
//
void combinator() :
{/*@bgen(jjtree) combinator */
SimpleNode jjtn000 = new SimpleNode(JJTCOMBINATOR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) combinator */
try {
/*@egen*/
( ( ( | ) )*
| ( ( | ) )*
| ( | ) ( ( | ) ( ( | ) )* )? )/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// unary_operator
// : '-' | '+'
// ;
//
void unaryOperator() :
{/*@bgen(jjtree) unaryOperator */
SimpleNode jjtn000 = new SimpleNode(JJTUNARYOPERATOR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) unaryOperator */
try {
/*@egen*/
( | )/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// property
// : IDENT S*
// ;
//
void property() :
{/*@bgen(jjtree) property */
SimpleNode jjtn000 = new SimpleNode(JJTPROPERTY);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) property */
try {
/*@egen*/
( | | ) ( ( | ) )*/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// ruleset
// : selector [ ',' S* selector ]*
// '{' S* declaration [ ';' S* declaration ]* '}' S*
// ;
//
//TODO marek: resolve the error reporting and recovery in styleRule()
void styleRule() :
{/*@bgen(jjtree) styleRule */
SimpleNode jjtn000 = new SimpleNode(JJTSTYLERULE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) styleRule */
try {
/*@egen*/
try {
selectorList()
( ( | ) )*
( declaration() )?
( ( ( | ) )* ( declaration() )? )*
} catch(ParseException e) {
reportError(e);
error_skipblock();
}/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void selectorList() :
{/*@bgen(jjtree) selectorList */
SimpleNode jjtn000 = new SimpleNode(JJTSELECTORLIST);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) selectorList */
try {
/*@egen*/
try {
selector()
( ( ( | ) )* selector() )*
} catch (ParseException e) {
reportError(e);
}/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// selector
// : simple_selector [ combinator simple_selector ]*
// ;
//
void selector() :
{/*@bgen(jjtree) selector */
SimpleNode jjtn000 = new SimpleNode(JJTSELECTOR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) selector */
try {
/*@egen*/
try {
simpleSelector()
( LOOKAHEAD(2) combinator() simpleSelector() )* ( ( | ) )*
} catch (ParseException e) {
reportError(e);
skipSelector();
}/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// simple_selector
// : element_name? [ HASH | class | attrib | pseudo ]* S*
// ;
//
void simpleSelector() :
{/*@bgen(jjtree) simpleSelector */
SimpleNode jjtn000 = new SimpleNode(JJTSIMPLESELECTOR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) simpleSelector */
try {
/*@egen*/
(
( elementName()
( hash()
| _class()
| attrib()
| pseudo()
)*
)
|
(
( hash()
| _class()
| attrib()
| pseudo()
)+
)
)/*@bgen(jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
jjtc000 = false;
} else {
jjtree.popNode();
}
if (jjte000 instanceof RuntimeException) {
throw (RuntimeException)jjte000;
}
if (jjte000 instanceof ParseException) {
throw (ParseException)jjte000;
}
throw (Error)jjte000;
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// class
// : '.' IDENT
// ;
//
void _class() :
{/*@bgen(jjtree) _class */
SimpleNode jjtn000 = new SimpleNode(JJT_CLASS);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) _class */
try {
/*@egen*/
( | )/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// element_name
// : IDENT | '*'
// ;
//
void elementName() :
{/*@bgen(jjtree) elementName */
SimpleNode jjtn000 = new SimpleNode(JJTELEMENTNAME);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) elementName */
try {
/*@egen*/
| | /*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// attrib
// : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S*
// [ IDENT | STRING ] S* ]? ']'
// ;
//
void attrib() :
{/*@bgen(jjtree) attrib */
SimpleNode jjtn000 = new SimpleNode(JJTATTRIB);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) attrib */
try {
/*@egen*/
( ( | ) )*
( ) ( ( | ) )*
(
(
|
|
|
|
|
)
( ( | ) )*
(
( )
|
)
( ( | ) )*
)?
/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
//
// pseudo
// : ':' [ IDENT | FUNCTION S* IDENT S* ')' ]
// ;
//
void pseudo() :
{/*@bgen(jjtree) pseudo */
SimpleNode jjtn000 = new SimpleNode(JJTPSEUDO);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) pseudo */
try {
/*@egen*/
(
( | )
|
(
( ( | ) )*
( (()? ) | ) ( ( | ) )*
)
)/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void hash() :
{/*@bgen(jjtree) hash */
SimpleNode jjtn000 = new SimpleNode(JJTHASH);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) hash */
try {
/*@egen*/
/*@bgen(jjtree)*/
} finally {
if (jjtc000) {
jjtree.closeNodeScope(jjtn000, true);
jjtn000.jjtSetLastToken(getToken(0));
}
}
/*@egen*/
}
void styleDeclaration() :
{/*@bgen(jjtree) styleDeclaration */
SimpleNode jjtn000 = new SimpleNode(JJTSTYLEDECLARATION);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
/*@egen*/
}
{/*@bgen(jjtree) styleDeclaration */
try {
/*@egen*/