From b3959b515fce642b4f873a25f1c13c604512d9fe Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 19 Jul 2016 17:27:44 +0200 Subject: Update qcssscanner so it can parse our normal offline documentation CSS Adds the three CSS3 attribute selectors. During this the internal naming of the existing attribute-selectors have been changed to be more clear, and the dash-matching has been fixed to not just be beginsWith. A non-breaking space have also been removed from the CSS. Change-Id: Ia4db4a5a19e3ceee8c3c8a4b744149edd1d32bdc Reviewed-by: Simon Hausmann --- src/gui/text/qcssparser.cpp | 48 ++- src/gui/text/qcssparser_p.h | 10 +- src/gui/text/qcssscanner.cpp | 853 ++++++++++++++++++++++--------------------- 3 files changed, 484 insertions(+), 427 deletions(-) (limited to 'src') diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 940de87eee..5138f7e94c 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -1914,18 +1914,38 @@ bool StyleSelector::basicSelectorMatches(const BasicSelector &sel, NodePtr node) if (attrValue.isNull()) return false; - if (a.valueMatchCriterium == QCss::AttributeSelector::MatchContains) { + switch (a.valueMatchCriterium) { + case QCss::AttributeSelector::NoMatch: + break; + case QCss::AttributeSelector::MatchEqual: + if (attrValue != a.value) + return false; + break; + case QCss::AttributeSelector::MatchIncludes: { const auto lst = attrValue.splitRef(QLatin1Char(' ')); if (!lst.contains(QStringRef(&a.value))) return false; - } else if ( - (a.valueMatchCriterium == QCss::AttributeSelector::MatchEqual - && attrValue != a.value) - || - (a.valueMatchCriterium == QCss::AttributeSelector::MatchBeginsWith - && !attrValue.startsWith(a.value)) - ) - return false; + break; + } + case QCss::AttributeSelector::MatchDashMatch: { + const QString dashPrefix = a.value + QLatin1Char('-'); + if (attrValue != a.value && !attrValue.startsWith(dashPrefix)) + return false; + break; + } + case QCss::AttributeSelector::MatchBeginsWith: + if (!attrValue.startsWith(a.value)) + return false; + break; + case QCss::AttributeSelector::MatchEndsWith: + if (!attrValue.endsWith(a.value)) + return false; + break; + case QCss::AttributeSelector::MatchContains: + if (!attrValue.contains(a.value)) + return false; + break; + } } } @@ -2439,7 +2459,7 @@ bool Parser::parseSimpleSelector(BasicSelector *basicSel) onceMore = true; AttributeSelector a; a.name = QLatin1String("class"); - a.valueMatchCriterium = AttributeSelector::MatchContains; + a.valueMatchCriterium = AttributeSelector::MatchIncludes; if (!parseClass(&a.value)) return false; basicSel->attributeSelectors.append(a); } else if (testAttrib()) { @@ -2485,9 +2505,15 @@ bool Parser::parseAttrib(AttributeSelector *attr) if (test(EQUAL)) { attr->valueMatchCriterium = AttributeSelector::MatchEqual; } else if (test(INCLUDES)) { - attr->valueMatchCriterium = AttributeSelector::MatchContains; + attr->valueMatchCriterium = AttributeSelector::MatchIncludes; } else if (test(DASHMATCH)) { + attr->valueMatchCriterium = AttributeSelector::MatchDashMatch; + } else if (test(BEGINSWITH)) { attr->valueMatchCriterium = AttributeSelector::MatchBeginsWith; + } else if (test(ENDSWITH)) { + attr->valueMatchCriterium = AttributeSelector::MatchEndsWith; + } else if (test(CONTAINS)) { + attr->valueMatchCriterium = AttributeSelector::MatchContains; } else { return next(RBRACKET); } diff --git a/src/gui/text/qcssparser_p.h b/src/gui/text/qcssparser_p.h index 8894e8819b..c40cb508fa 100644 --- a/src/gui/text/qcssparser_p.h +++ b/src/gui/text/qcssparser_p.h @@ -539,8 +539,11 @@ struct AttributeSelector enum ValueMatchType { NoMatch, MatchEqual, - MatchContains, - MatchBeginsWith + MatchIncludes, + MatchDashMatch, + MatchBeginsWith, + MatchEndsWith, + MatchContains }; inline AttributeSelector() : valueMatchCriterium(NoMatch) {} @@ -679,6 +682,9 @@ enum TokenType { CDC, INCLUDES, DASHMATCH, + BEGINSWITH, + ENDSWITH, + CONTAINS, LBRACE, PLUS, diff --git a/src/gui/text/qcssscanner.cpp b/src/gui/text/qcssscanner.cpp index f6b25d50ba..9ee075e492 100644 --- a/src/gui/text/qcssscanner.cpp +++ b/src/gui/text/qcssscanner.cpp @@ -88,8 +88,10 @@ int QCssScanner_Generated::lex() goto state_3; if (ch.unicode() == 35) goto state_4; - if (ch.unicode() == 39) + if (ch.unicode() == 36) goto state_5; + if (ch.unicode() == 39) + goto state_6; if (ch.unicode() == 40) { token = QCss::LPAREN; goto found; @@ -98,22 +100,20 @@ int QCssScanner_Generated::lex() token = QCss::RPAREN; goto found; } - if (ch.unicode() == 42) { - token = QCss::STAR; - goto found; - } - if (ch.unicode() == 43) + if (ch.unicode() == 42) goto state_9; - if (ch.unicode() == 44) + if (ch.unicode() == 43) goto state_10; - if (ch.unicode() == 45) + if (ch.unicode() == 44) goto state_11; - if (ch.unicode() == 46) + if (ch.unicode() == 45) goto state_12; - if (ch.unicode() == 47) + if (ch.unicode() == 46) goto state_13; - if (ch.unicode() >= 48 && ch.unicode() <= 57) + if (ch.unicode() == 47) goto state_14; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_15; if (ch.unicode() == 58) { token = QCss::COLON; goto found; @@ -123,147 +123,165 @@ int QCssScanner_Generated::lex() goto found; } if (ch.unicode() == 60) - goto state_17; + goto state_18; if (ch.unicode() == 61) { token = QCss::EQUAL; goto found; } if (ch.unicode() == 62) - goto state_19; - if (ch.unicode() == 64) goto state_20; + if (ch.unicode() == 64) + goto state_21; if (ch.unicode() == 91) { token = QCss::LBRACKET; goto found; } if (ch.unicode() == 92) - goto state_22; + goto state_23; if (ch.unicode() == 93) { token = QCss::RBRACKET; goto found; } + if (ch.unicode() == 94) + goto state_25; if (ch.unicode() == 95) - goto state_24; + goto state_26; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_24; + goto state_26; if (ch.unicode() == 123) - goto state_25; + goto state_27; if (ch.unicode() == 124) - goto state_26; + goto state_28; if (ch.unicode() == 125) { token = QCss::RBRACE; goto found; } if (ch.unicode() == 126) - goto state_28; + goto state_30; goto out; state_1: lastAcceptingPos = pos; token = QCss::S; ch = next(); if (ch.unicode() >= 9 && ch.unicode() <= 10) - goto state_29; + goto state_31; if (ch.unicode() >= 12 && ch.unicode() <= 13) - goto state_29; + goto state_31; if (ch.unicode() == 32) - goto state_29; + goto state_31; if (ch.unicode() == 43) - goto state_9; - if (ch.unicode() == 44) goto state_10; + if (ch.unicode() == 44) + goto state_11; if (ch.unicode() == 62) - goto state_19; + goto state_20; if (ch.unicode() == 123) - goto state_25; + goto state_27; goto out; state_3: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_30; + goto state_32; if (ch.unicode() == 11) - goto state_30; + goto state_32; if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_30; + goto state_32; if (ch.unicode() == 34) - goto state_31; + goto state_33; if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_30; - if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 92) + goto state_34; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_30; + goto state_32; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_30; + goto state_32; if (ch.unicode() >= 123) - goto state_30; + goto state_32; goto out; state_4: ch = next(); if (ch.unicode() == 45) - goto state_33; + goto state_35; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_33; + goto state_35; if (ch.unicode() == 92) - goto state_34; + goto state_36; if (ch.unicode() == 95) - goto state_33; + goto state_35; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_33; + goto state_35; goto out; state_5: + ch = next(); + if (ch.unicode() == 61) { + token = QCss::ENDSWITH; + goto found; + } + goto out; + state_6: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_35; + goto state_38; if (ch.unicode() == 11) - goto state_35; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_35; + goto state_38; if (ch.unicode() == 39) - goto state_36; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_35; + goto state_38; if (ch.unicode() == 92) - goto state_37; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_35; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_35; + goto state_38; if (ch.unicode() >= 123) - goto state_35; + goto state_38; goto out; state_9: lastAcceptingPos = pos; - token = QCss::PLUS; + token = QCss::STAR; + ch = next(); + if (ch.unicode() == 61) { + token = QCss::CONTAINS; + goto found; + } goto out; state_10: lastAcceptingPos = pos; - token = QCss::COMMA; + token = QCss::PLUS; goto out; state_11: + lastAcceptingPos = pos; + token = QCss::COMMA; + goto out; + state_12: lastAcceptingPos = pos; token = QCss::MINUS; ch = next(); if (ch.unicode() == 45) - goto state_38; + goto state_42; if (ch.unicode() == 92) - goto state_22; + goto state_23; if (ch.unicode() == 95) - goto state_24; + goto state_26; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_24; + goto state_26; goto out; - state_12: + state_13: lastAcceptingPos = pos; token = QCss::DOT; ch = next(); if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_39; + goto state_43; goto out; - state_13: + state_14: lastAcceptingPos = pos; token = QCss::SLASH; ch = next(); @@ -272,80 +290,87 @@ int QCssScanner_Generated::lex() goto found; } goto out; - state_14: + state_15: lastAcceptingPos = pos; token = QCss::NUMBER; ch = next(); if (ch.unicode() == 37) - goto state_41; + goto state_45; if (ch.unicode() == 45) - goto state_42; + goto state_46; if (ch.unicode() == 46) - goto state_43; + goto state_47; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_44; + goto state_48; if (ch.unicode() == 92) - goto state_45; + goto state_49; if (ch.unicode() == 95) - goto state_46; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_46; + goto state_50; goto out; - state_17: + state_18: ch = next(); if (ch.unicode() == 33) - goto state_47; + goto state_51; goto out; - state_19: + state_20: lastAcceptingPos = pos; token = QCss::GREATER; goto out; - state_20: + state_21: ch = next(); if (ch.unicode() == 45) - goto state_48; + goto state_52; if (ch.unicode() == 92) - goto state_49; + goto state_53; if (ch.unicode() == 95) - goto state_50; + goto state_54; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_50; + goto state_54; goto out; - state_22: + state_23: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_51; + goto state_55; if (ch.unicode() == 11) - goto state_51; + goto state_55; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_51; + goto state_55; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_51; + goto state_55; if (ch.unicode() >= 103) - goto state_51; + goto state_55; goto out; - state_24: + state_25: + ch = next(); + if (ch.unicode() == 61) { + token = QCss::BEGINSWITH; + goto found; + } + goto out; + state_26: lastAcceptingPos = pos; token = QCss::IDENT; ch = next(); if (ch.unicode() == 40) - goto state_52; + goto state_57; if (ch.unicode() == 45) - goto state_53; + goto state_58; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_53; + goto state_58; if (ch.unicode() == 92) - goto state_54; + goto state_59; if (ch.unicode() == 95) - goto state_53; + goto state_58; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_53; + goto state_58; goto out; - state_25: + state_27: lastAcceptingPos = pos; token = QCss::LBRACE; goto out; - state_26: + state_28: lastAcceptingPos = pos; token = QCss::OR; ch = next(); @@ -354,782 +379,782 @@ int QCssScanner_Generated::lex() goto found; } goto out; - state_28: + state_30: ch = next(); if (ch.unicode() == 61) { token = QCss::INCLUDES; goto found; } goto out; - state_29: + state_31: lastAcceptingPos = pos; token = QCss::S; ch = next(); if (ch.unicode() >= 9 && ch.unicode() <= 10) - goto state_29; + goto state_31; if (ch.unicode() >= 12 && ch.unicode() <= 13) - goto state_29; + goto state_31; if (ch.unicode() == 32) - goto state_29; + goto state_31; if (ch.unicode() == 43) - goto state_9; - if (ch.unicode() == 44) goto state_10; + if (ch.unicode() == 44) + goto state_11; if (ch.unicode() == 62) - goto state_19; + goto state_20; if (ch.unicode() == 123) - goto state_25; + goto state_27; goto out; - state_30: + state_32: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_30; + goto state_32; if (ch.unicode() == 11) - goto state_30; + goto state_32; if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_30; + goto state_32; if (ch.unicode() == 34) - goto state_31; + goto state_33; if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_30; - if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 92) + goto state_34; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_30; + goto state_32; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_30; + goto state_32; if (ch.unicode() >= 123) - goto state_30; + goto state_32; goto out; - state_31: + state_33: lastAcceptingPos = pos; token = QCss::STRING; goto out; - state_32: + state_34: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_57; + goto state_62; if (ch.unicode() == 10) - goto state_58; + goto state_63; if (ch.unicode() == 11) - goto state_57; + goto state_62; if (ch.unicode() == 12) - goto state_59; + goto state_64; if (ch.unicode() == 13) - goto state_60; + goto state_65; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_57; + goto state_62; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_57; + goto state_62; if (ch.unicode() >= 103) - goto state_57; + goto state_62; goto out; - state_33: + state_35: lastAcceptingPos = pos; token = QCss::HASH; ch = next(); if (ch.unicode() == 45) - goto state_61; + goto state_66; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_61; + goto state_66; if (ch.unicode() == 92) - goto state_62; + goto state_67; if (ch.unicode() == 95) - goto state_61; + goto state_66; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_61; + goto state_66; goto out; - state_34: + state_36: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_63; + goto state_68; if (ch.unicode() == 11) - goto state_63; + goto state_68; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_63; + goto state_68; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_63; + goto state_68; if (ch.unicode() >= 103) - goto state_63; + goto state_68; goto out; - state_35: + state_38: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_35; + goto state_38; if (ch.unicode() == 11) - goto state_35; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_35; + goto state_38; if (ch.unicode() == 39) - goto state_36; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_35; + goto state_38; if (ch.unicode() == 92) - goto state_37; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_35; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_35; + goto state_38; if (ch.unicode() >= 123) - goto state_35; + goto state_38; goto out; - state_36: + state_39: lastAcceptingPos = pos; token = QCss::STRING; goto out; - state_37: + state_40: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_64; + goto state_69; if (ch.unicode() == 10) - goto state_65; + goto state_70; if (ch.unicode() == 11) - goto state_64; + goto state_69; if (ch.unicode() == 12) - goto state_66; + goto state_71; if (ch.unicode() == 13) - goto state_67; + goto state_72; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_64; + goto state_69; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_64; + goto state_69; if (ch.unicode() >= 103) - goto state_64; + goto state_69; goto out; - state_38: + state_42: ch = next(); if (ch.unicode() == 62) { token = QCss::CDC; goto found; } goto out; - state_39: + state_43: lastAcceptingPos = pos; token = QCss::NUMBER; ch = next(); if (ch.unicode() == 37) - goto state_41; + goto state_45; if (ch.unicode() == 45) - goto state_42; + goto state_46; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_69; + goto state_74; if (ch.unicode() == 92) - goto state_45; + goto state_49; if (ch.unicode() == 95) - goto state_46; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_46; + goto state_50; goto out; - state_41: + state_45: lastAcceptingPos = pos; token = QCss::PERCENTAGE; goto out; - state_42: + state_46: ch = next(); if (ch.unicode() == 92) - goto state_45; + goto state_49; if (ch.unicode() == 95) - goto state_46; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_46; + goto state_50; goto out; - state_43: + state_47: ch = next(); if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_39; + goto state_43; goto out; - state_44: + state_48: lastAcceptingPos = pos; token = QCss::NUMBER; ch = next(); if (ch.unicode() == 37) - goto state_41; + goto state_45; if (ch.unicode() == 45) - goto state_42; + goto state_46; if (ch.unicode() == 46) - goto state_43; + goto state_47; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_44; + goto state_48; if (ch.unicode() == 92) - goto state_45; + goto state_49; if (ch.unicode() == 95) - goto state_46; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_46; + goto state_50; goto out; - state_45: + state_49: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_70; + goto state_75; if (ch.unicode() == 11) - goto state_70; + goto state_75; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_70; + goto state_75; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_70; + goto state_75; if (ch.unicode() >= 103) - goto state_70; + goto state_75; goto out; - state_46: + state_50: lastAcceptingPos = pos; token = QCss::LENGTH; ch = next(); if (ch.unicode() == 45) - goto state_71; + goto state_76; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_71; + goto state_76; if (ch.unicode() == 92) - goto state_72; + goto state_77; if (ch.unicode() == 95) - goto state_71; + goto state_76; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_71; + goto state_76; goto out; - state_47: + state_51: ch = next(); if (ch.unicode() == 45) - goto state_73; + goto state_78; goto out; - state_48: + state_52: ch = next(); if (ch.unicode() == 92) - goto state_49; + goto state_53; if (ch.unicode() == 95) - goto state_50; + goto state_54; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_50; + goto state_54; goto out; - state_49: + state_53: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_74; + goto state_79; if (ch.unicode() == 11) - goto state_74; + goto state_79; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_74; + goto state_79; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_74; + goto state_79; if (ch.unicode() >= 103) - goto state_74; + goto state_79; goto out; - state_50: + state_54: lastAcceptingPos = pos; token = QCss::ATKEYWORD_SYM; ch = next(); if (ch.unicode() == 45) - goto state_75; + goto state_80; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_75; + goto state_80; if (ch.unicode() == 92) - goto state_76; + goto state_81; if (ch.unicode() == 95) - goto state_75; + goto state_80; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_75; + goto state_80; goto out; - state_51: + state_55: lastAcceptingPos = pos; token = QCss::IDENT; ch = next(); if (ch.unicode() == 40) - goto state_52; + goto state_57; if (ch.unicode() == 45) - goto state_53; + goto state_58; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_53; + goto state_58; if (ch.unicode() == 92) - goto state_54; + goto state_59; if (ch.unicode() == 95) - goto state_53; + goto state_58; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_53; + goto state_58; goto out; - state_52: + state_57: lastAcceptingPos = pos; token = QCss::FUNCTION; goto out; - state_53: + state_58: lastAcceptingPos = pos; token = QCss::IDENT; ch = next(); if (ch.unicode() == 40) - goto state_52; + goto state_57; if (ch.unicode() == 45) - goto state_53; + goto state_58; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_53; + goto state_58; if (ch.unicode() == 92) - goto state_54; + goto state_59; if (ch.unicode() == 95) - goto state_53; + goto state_58; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_53; + goto state_58; goto out; - state_54: + state_59: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_77; + goto state_82; if (ch.unicode() == 11) - goto state_77; + goto state_82; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_77; + goto state_82; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_77; + goto state_82; if (ch.unicode() >= 103) - goto state_77; + goto state_82; goto out; - state_57: + state_62: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_30; + goto state_32; if (ch.unicode() == 11) - goto state_30; + goto state_32; if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_30; + goto state_32; if (ch.unicode() == 34) - goto state_31; + goto state_33; if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_30; - if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 92) + goto state_34; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_30; + goto state_32; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_30; + goto state_32; if (ch.unicode() >= 123) - goto state_30; + goto state_32; goto out; - state_58: + state_63: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_30; + goto state_32; if (ch.unicode() == 11) - goto state_30; + goto state_32; if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_30; + goto state_32; if (ch.unicode() == 34) - goto state_31; + goto state_33; if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_30; - if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 92) + goto state_34; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_30; + goto state_32; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_30; + goto state_32; if (ch.unicode() >= 123) - goto state_30; + goto state_32; goto out; - state_59: + state_64: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_30; + goto state_32; if (ch.unicode() == 11) - goto state_30; + goto state_32; if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_30; + goto state_32; if (ch.unicode() == 34) - goto state_31; + goto state_33; if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_30; - if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 92) + goto state_34; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_30; + goto state_32; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_30; + goto state_32; if (ch.unicode() >= 123) - goto state_30; + goto state_32; goto out; - state_60: + state_65: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_30; + goto state_32; if (ch.unicode() == 10) - goto state_78; + goto state_83; if (ch.unicode() == 11) - goto state_30; + goto state_32; if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_30; + goto state_32; if (ch.unicode() == 34) - goto state_31; + goto state_33; if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_30; - if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 92) + goto state_34; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_30; + goto state_32; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_30; + goto state_32; if (ch.unicode() >= 123) - goto state_30; + goto state_32; goto out; - state_61: + state_66: lastAcceptingPos = pos; token = QCss::HASH; ch = next(); if (ch.unicode() == 45) - goto state_61; + goto state_66; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_61; + goto state_66; if (ch.unicode() == 92) - goto state_62; + goto state_67; if (ch.unicode() == 95) - goto state_61; + goto state_66; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_61; + goto state_66; goto out; - state_62: + state_67: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_79; + goto state_84; if (ch.unicode() == 11) - goto state_79; + goto state_84; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_79; + goto state_84; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_79; + goto state_84; if (ch.unicode() >= 103) - goto state_79; + goto state_84; goto out; - state_63: + state_68: lastAcceptingPos = pos; token = QCss::HASH; ch = next(); if (ch.unicode() == 45) - goto state_61; + goto state_66; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_61; + goto state_66; if (ch.unicode() == 92) - goto state_62; + goto state_67; if (ch.unicode() == 95) - goto state_61; + goto state_66; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_61; + goto state_66; goto out; - state_64: + state_69: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_35; + goto state_38; if (ch.unicode() == 11) - goto state_35; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_35; + goto state_38; if (ch.unicode() == 39) - goto state_36; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_35; + goto state_38; if (ch.unicode() == 92) - goto state_37; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_35; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_35; + goto state_38; if (ch.unicode() >= 123) - goto state_35; + goto state_38; goto out; - state_65: + state_70: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_35; + goto state_38; if (ch.unicode() == 11) - goto state_35; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_35; + goto state_38; if (ch.unicode() == 39) - goto state_36; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_35; + goto state_38; if (ch.unicode() == 92) - goto state_37; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_35; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_35; + goto state_38; if (ch.unicode() >= 123) - goto state_35; + goto state_38; goto out; - state_66: + state_71: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_35; + goto state_38; if (ch.unicode() == 11) - goto state_35; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_35; + goto state_38; if (ch.unicode() == 39) - goto state_36; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_35; + goto state_38; if (ch.unicode() == 92) - goto state_37; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_35; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_35; + goto state_38; if (ch.unicode() >= 123) - goto state_35; + goto state_38; goto out; - state_67: + state_72: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_35; + goto state_38; if (ch.unicode() == 10) - goto state_80; + goto state_85; if (ch.unicode() == 11) - goto state_35; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_35; + goto state_38; if (ch.unicode() == 39) - goto state_36; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_35; + goto state_38; if (ch.unicode() == 92) - goto state_37; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_35; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_35; + goto state_38; if (ch.unicode() >= 123) - goto state_35; + goto state_38; goto out; - state_69: + state_74: lastAcceptingPos = pos; token = QCss::NUMBER; ch = next(); if (ch.unicode() == 37) - goto state_41; + goto state_45; if (ch.unicode() == 45) - goto state_42; + goto state_46; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_69; + goto state_74; if (ch.unicode() == 92) - goto state_45; + goto state_49; if (ch.unicode() == 95) - goto state_46; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_46; + goto state_50; goto out; - state_70: + state_75: lastAcceptingPos = pos; token = QCss::LENGTH; ch = next(); if (ch.unicode() == 45) - goto state_71; + goto state_76; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_71; + goto state_76; if (ch.unicode() == 92) - goto state_72; + goto state_77; if (ch.unicode() == 95) - goto state_71; + goto state_76; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_71; + goto state_76; goto out; - state_71: + state_76: lastAcceptingPos = pos; token = QCss::LENGTH; ch = next(); if (ch.unicode() == 45) - goto state_71; + goto state_76; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_71; + goto state_76; if (ch.unicode() == 92) - goto state_72; + goto state_77; if (ch.unicode() == 95) - goto state_71; + goto state_76; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_71; + goto state_76; goto out; - state_72: + state_77: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_81; + goto state_86; if (ch.unicode() == 11) - goto state_81; + goto state_86; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_81; + goto state_86; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_81; + goto state_86; if (ch.unicode() >= 103) - goto state_81; + goto state_86; goto out; - state_73: + state_78: ch = next(); if (ch.unicode() == 45) { token = QCss::CDO; goto found; } goto out; - state_74: + state_79: lastAcceptingPos = pos; token = QCss::ATKEYWORD_SYM; ch = next(); if (ch.unicode() == 45) - goto state_75; + goto state_80; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_75; + goto state_80; if (ch.unicode() == 92) - goto state_76; + goto state_81; if (ch.unicode() == 95) - goto state_75; + goto state_80; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_75; + goto state_80; goto out; - state_75: + state_80: lastAcceptingPos = pos; token = QCss::ATKEYWORD_SYM; ch = next(); if (ch.unicode() == 45) - goto state_75; + goto state_80; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_75; + goto state_80; if (ch.unicode() == 92) - goto state_76; + goto state_81; if (ch.unicode() == 95) - goto state_75; + goto state_80; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_75; + goto state_80; goto out; - state_76: + state_81: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_83; + goto state_88; if (ch.unicode() == 11) - goto state_83; + goto state_88; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_83; + goto state_88; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_83; + goto state_88; if (ch.unicode() >= 103) - goto state_83; + goto state_88; goto out; - state_77: + state_82: lastAcceptingPos = pos; token = QCss::IDENT; ch = next(); if (ch.unicode() == 40) - goto state_52; + goto state_57; if (ch.unicode() == 45) - goto state_53; + goto state_58; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_53; + goto state_58; if (ch.unicode() == 92) - goto state_54; + goto state_59; if (ch.unicode() == 95) - goto state_53; + goto state_58; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_53; + goto state_58; goto out; - state_78: + state_83: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_30; + goto state_32; if (ch.unicode() == 11) - goto state_30; + goto state_32; if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_30; + goto state_32; if (ch.unicode() == 34) - goto state_31; + goto state_33; if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_30; - if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 92) + goto state_34; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_30; + goto state_32; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_30; + goto state_32; if (ch.unicode() >= 123) - goto state_30; + goto state_32; goto out; - state_79: + state_84: lastAcceptingPos = pos; token = QCss::HASH; ch = next(); if (ch.unicode() == 45) - goto state_61; + goto state_66; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_61; + goto state_66; if (ch.unicode() == 92) - goto state_62; + goto state_67; if (ch.unicode() == 95) - goto state_61; + goto state_66; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_61; + goto state_66; goto out; - state_80: + state_85: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_35; + goto state_38; if (ch.unicode() == 11) - goto state_35; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_35; + goto state_38; if (ch.unicode() == 39) - goto state_36; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_35; + goto state_38; if (ch.unicode() == 92) - goto state_37; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_35; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_35; + goto state_38; if (ch.unicode() >= 123) - goto state_35; + goto state_38; goto out; - state_81: + state_86: lastAcceptingPos = pos; token = QCss::LENGTH; ch = next(); if (ch.unicode() == 45) - goto state_71; + goto state_76; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_71; + goto state_76; if (ch.unicode() == 92) - goto state_72; + goto state_77; if (ch.unicode() == 95) - goto state_71; + goto state_76; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_71; + goto state_76; goto out; - state_83: + state_88: lastAcceptingPos = pos; token = QCss::ATKEYWORD_SYM; ch = next(); if (ch.unicode() == 45) - goto state_75; + goto state_80; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_75; + goto state_80; if (ch.unicode() == 92) - goto state_76; + goto state_81; if (ch.unicode() == 95) - goto state_75; + goto state_80; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_75; + goto state_80; goto out; found: lastAcceptingPos = pos; -- cgit v1.2.3