diff --git a/src/gui/text/qcssscanner.cpp b/src/gui/text/qcssscanner.cpp index 33dc01c8bc4..d48cbb71d76 100644 --- a/src/gui/text/qcssscanner.cpp +++ b/src/gui/text/qcssscanner.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtGui module of the Qt Toolkit. @@ -37,7 +37,7 @@ ** ****************************************************************************/ -// auto generated. DO NOT EDIT. +// auto generated by qtbase/util/lexgen/. DO NOT EDIT. class QCssScanner_Generated { public: @@ -75,23 +75,23 @@ int QCssScanner_Generated::lex() // initial state ch = next(); if (ch.unicode() >= 9 && ch.unicode() <= 10) - goto state_1; + goto state_4; if (ch.unicode() >= 12 && ch.unicode() <= 13) - goto state_1; + goto state_4; if (ch.unicode() == 32) - goto state_1; + goto state_4; if (ch.unicode() == 33) { token = QCss::EXCLAMATION_SYM; goto found; } if (ch.unicode() == 34) - goto state_3; + goto state_2; if (ch.unicode() == 35) - goto state_4; + goto state_1; if (ch.unicode() == 36) - goto state_5; - if (ch.unicode() == 39) goto state_6; + if (ch.unicode() == 39) + goto state_5; if (ch.unicode() == 40) { token = QCss::LPAREN; goto found; @@ -101,17 +101,17 @@ int QCssScanner_Generated::lex() goto found; } if (ch.unicode() == 42) - goto state_9; + goto state_8; if (ch.unicode() == 43) - goto state_10; + goto state_7; if (ch.unicode() == 44) - goto state_11; - if (ch.unicode() == 45) - goto state_12; - if (ch.unicode() == 46) - goto state_13; - if (ch.unicode() == 47) goto state_14; + if (ch.unicode() == 45) + goto state_13; + if (ch.unicode() == 46) + goto state_12; + if (ch.unicode() == 47) + goto state_11; if (ch.unicode() >= 48 && ch.unicode() <= 57) goto state_15; if (ch.unicode() == 58) { @@ -123,64 +123,56 @@ int QCssScanner_Generated::lex() goto found; } if (ch.unicode() == 60) - goto state_18; + goto state_20; if (ch.unicode() == 61) { token = QCss::EQUAL; goto found; } if (ch.unicode() == 62) - goto state_20; + goto state_18; if (ch.unicode() == 64) - goto state_21; + goto state_26; if (ch.unicode() == 91) { token = QCss::LBRACKET; goto found; } if (ch.unicode() == 92) - goto state_23; + goto state_30; if (ch.unicode() == 93) { token = QCss::RBRACKET; goto found; } if (ch.unicode() == 94) - goto state_25; - if (ch.unicode() == 95) - goto state_26; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_26; - if (ch.unicode() == 123) - goto state_27; - if (ch.unicode() == 124) goto state_28; + if (ch.unicode() == 95) + goto state_21; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_21; + if (ch.unicode() == 123) + goto state_22; + if (ch.unicode() == 124) + goto state_25; if (ch.unicode() == 125) { token = QCss::RBRACE; goto found; } if (ch.unicode() == 126) - goto state_30; + goto state_23; goto out; state_1: - lastAcceptingPos = pos; - token = QCss::S; ch = next(); - if (ch.unicode() >= 9 && ch.unicode() <= 10) + if (ch.unicode() == 45) goto state_31; - if (ch.unicode() >= 12 && ch.unicode() <= 13) + if (ch.unicode() >= 48 && ch.unicode() <= 57) goto state_31; - if (ch.unicode() == 32) - goto state_31; - if (ch.unicode() == 43) - goto state_10; - if (ch.unicode() == 44) - goto state_11; - if (ch.unicode() == 62) - goto state_20; - if (ch.unicode() == 123) - goto state_27; - if (ch.unicode() == 126) + if (ch.unicode() == 92) goto state_32; + if (ch.unicode() == 95) + goto state_31; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_31; goto out; - state_3: + state_2: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); @@ -204,49 +196,61 @@ int QCssScanner_Generated::lex() goto state_33; goto out; state_4: + lastAcceptingPos = pos; + token = QCss::S; ch = next(); - if (ch.unicode() == 45) + if (ch.unicode() >= 9 && ch.unicode() <= 10) goto state_36; - if (ch.unicode() >= 48 && ch.unicode() <= 57) + if (ch.unicode() >= 12 && ch.unicode() <= 13) goto state_36; - if (ch.unicode() == 92) + if (ch.unicode() == 32) + goto state_36; + if (ch.unicode() == 43) + goto state_7; + if (ch.unicode() == 44) + goto state_14; + if (ch.unicode() == 62) + goto state_18; + if (ch.unicode() == 123) + goto state_22; + if (ch.unicode() == 126) goto state_37; - if (ch.unicode() == 95) - goto state_36; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_36; goto out; state_5: + lastAcceptingPos = pos; + token = QCss::INVALID; + ch = next(); + if (ch.unicode() >= 1 && ch.unicode() <= 9) + goto state_38; + if (ch.unicode() == 11) + goto state_38; + if (ch.unicode() >= 14 && ch.unicode() <= 38) + goto state_38; + if (ch.unicode() == 39) + goto state_39; + if (ch.unicode() >= 40 && ch.unicode() <= 91) + goto state_38; + if (ch.unicode() == 92) + goto state_40; + if (ch.unicode() >= 93 && ch.unicode() <= 96) + goto state_38; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_38; + if (ch.unicode() >= 123) + goto state_38; + goto out; + state_6: ch = next(); if (ch.unicode() == 61) { token = QCss::ENDSWITH; goto found; } goto out; - state_6: + state_7: lastAcceptingPos = pos; - token = QCss::INVALID; - ch = next(); - if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_39; - if (ch.unicode() == 11) - goto state_39; - if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_39; - if (ch.unicode() == 39) - goto state_40; - if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_39; - if (ch.unicode() == 92) - goto state_41; - if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_39; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_39; - if (ch.unicode() >= 123) - goto state_39; + token = QCss::PLUS; goto out; - state_9: + state_8: lastAcceptingPos = pos; token = QCss::STAR; ch = next(); @@ -255,35 +259,7 @@ int QCssScanner_Generated::lex() goto found; } goto out; - state_10: - lastAcceptingPos = pos; - 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_43; - if (ch.unicode() == 92) - goto state_23; - if (ch.unicode() == 95) - goto state_26; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_26; - goto out; - state_13: - lastAcceptingPos = pos; - token = QCss::DOT; - ch = next(); - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_44; - goto out; - state_14: lastAcceptingPos = pos; token = QCss::SLASH; ch = next(); @@ -292,6 +268,30 @@ int QCssScanner_Generated::lex() goto found; } goto out; + state_12: + lastAcceptingPos = pos; + token = QCss::DOT; + ch = next(); + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_44; + goto out; + state_13: + lastAcceptingPos = pos; + token = QCss::MINUS; + ch = next(); + if (ch.unicode() == 45) + goto state_45; + if (ch.unicode() == 92) + goto state_30; + if (ch.unicode() == 95) + goto state_21; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_21; + goto out; + state_14: + lastAcceptingPos = pos; + token = QCss::COMMA; + goto out; state_15: lastAcceptingPos = pos; token = QCss::NUMBER; @@ -299,89 +299,49 @@ int QCssScanner_Generated::lex() if (ch.unicode() == 37) goto state_46; if (ch.unicode() == 45) - goto state_47; - if (ch.unicode() == 46) goto state_48; + if (ch.unicode() == 46) + goto state_47; if (ch.unicode() >= 48 && ch.unicode() <= 57) goto state_49; if (ch.unicode() == 92) - goto state_50; + goto state_51; if (ch.unicode() == 95) - goto state_51; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_51; + goto state_50; goto out; state_18: + lastAcceptingPos = pos; + token = QCss::GREATER; + goto out; + state_20: ch = next(); if (ch.unicode() == 33) goto state_52; goto out; - state_20: - lastAcceptingPos = pos; - token = QCss::GREATER; - goto out; state_21: - ch = next(); - if (ch.unicode() == 45) - goto state_53; - if (ch.unicode() == 92) - goto state_54; - if (ch.unicode() == 95) - goto state_55; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_55; - goto out; - state_23: - ch = next(); - if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_56; - if (ch.unicode() == 11) - goto state_56; - if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_56; - if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_56; - if (ch.unicode() >= 103) - goto state_56; - goto out; - 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_58; + goto state_53; if (ch.unicode() == 45) - goto state_59; + goto state_54; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_59; + goto state_54; if (ch.unicode() == 92) - goto state_60; + goto state_55; if (ch.unicode() == 95) - goto state_59; + goto state_54; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_59; + goto state_54; goto out; - state_27: + state_22: lastAcceptingPos = pos; token = QCss::LBRACE; goto out; - state_28: - lastAcceptingPos = pos; - token = QCss::OR; - ch = next(); - if (ch.unicode() == 61) { - token = QCss::DASHMATCH; - goto found; - } - goto out; - state_30: + state_23: lastAcceptingPos = pos; token = QCss::TILDE; ch = next(); @@ -390,30 +350,73 @@ int QCssScanner_Generated::lex() goto found; } goto out; + state_25: + lastAcceptingPos = pos; + token = QCss::OR; + ch = next(); + if (ch.unicode() == 61) { + token = QCss::DASHMATCH; + goto found; + } + goto out; + state_26: + ch = next(); + if (ch.unicode() == 45) + goto state_58; + if (ch.unicode() == 92) + goto state_60; + if (ch.unicode() == 95) + goto state_59; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_59; + goto out; + state_28: + ch = next(); + if (ch.unicode() == 61) { + token = QCss::BEGINSWITH; + goto found; + } + goto out; + state_30: + ch = next(); + if (ch.unicode() >= 1 && ch.unicode() <= 9) + goto state_62; + if (ch.unicode() == 11) + goto state_62; + if (ch.unicode() >= 14 && ch.unicode() <= 47) + goto state_62; + if (ch.unicode() >= 58 && ch.unicode() <= 96) + goto state_62; + if (ch.unicode() >= 103) + goto state_62; + goto out; state_31: lastAcceptingPos = pos; - token = QCss::S; + token = QCss::HASH; ch = next(); - if (ch.unicode() >= 9 && ch.unicode() <= 10) - goto state_31; - if (ch.unicode() >= 12 && ch.unicode() <= 13) - goto state_31; - if (ch.unicode() == 32) - goto state_31; - if (ch.unicode() == 43) - goto state_10; - if (ch.unicode() == 44) - goto state_11; - if (ch.unicode() == 62) - goto state_20; - if (ch.unicode() == 123) - goto state_27; - if (ch.unicode() == 126) - goto state_32; + if (ch.unicode() == 45) + goto state_63; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_63; + if (ch.unicode() == 92) + goto state_64; + if (ch.unicode() == 95) + goto state_63; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_63; goto out; state_32: - lastAcceptingPos = pos; - token = QCss::TILDE; + ch = next(); + if (ch.unicode() >= 1 && ch.unicode() <= 9) + goto state_65; + if (ch.unicode() == 11) + goto state_65; + if (ch.unicode() >= 14 && ch.unicode() <= 47) + goto state_65; + if (ch.unicode() >= 58 && ch.unicode() <= 96) + goto state_65; + if (ch.unicode() >= 103) + goto state_65; goto out; state_33: lastAcceptingPos = pos; @@ -445,78 +448,75 @@ int QCssScanner_Generated::lex() state_35: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_63; - if (ch.unicode() == 10) - goto state_64; - if (ch.unicode() == 11) - goto state_63; - if (ch.unicode() == 12) - goto state_65; - if (ch.unicode() == 13) goto state_66; + if (ch.unicode() == 10) + goto state_67; + if (ch.unicode() == 11) + goto state_66; + if (ch.unicode() == 12) + goto state_69; + if (ch.unicode() == 13) + goto state_68; if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_63; + goto state_66; if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_63; + goto state_66; if (ch.unicode() >= 103) - goto state_63; + goto state_66; goto out; state_36: lastAcceptingPos = pos; - token = QCss::HASH; + token = QCss::S; ch = next(); - if (ch.unicode() == 45) - goto state_67; - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_67; - if (ch.unicode() == 92) - goto state_68; - if (ch.unicode() == 95) - goto state_67; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_67; + if (ch.unicode() >= 9 && ch.unicode() <= 10) + goto state_36; + if (ch.unicode() >= 12 && ch.unicode() <= 13) + goto state_36; + if (ch.unicode() == 32) + goto state_36; + if (ch.unicode() == 43) + goto state_7; + if (ch.unicode() == 44) + goto state_14; + if (ch.unicode() == 62) + goto state_18; + if (ch.unicode() == 123) + goto state_22; + if (ch.unicode() == 126) + goto state_37; goto out; state_37: - ch = next(); - if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_69; - if (ch.unicode() == 11) - goto state_69; - if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_69; - if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_69; - if (ch.unicode() >= 103) - goto state_69; + lastAcceptingPos = pos; + token = QCss::TILDE; goto out; - state_39: + state_38: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_39; + goto state_38; if (ch.unicode() == 11) - goto state_39; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_39; + goto state_38; if (ch.unicode() == 39) - goto state_40; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_39; + goto state_38; if (ch.unicode() == 92) - goto state_41; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_39; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_39; + goto state_38; if (ch.unicode() >= 123) - goto state_39; + goto state_38; goto out; - state_40: + state_39: lastAcceptingPos = pos; token = QCss::STRING; goto out; - state_41: + state_40: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) goto state_70; @@ -525,9 +525,9 @@ int QCssScanner_Generated::lex() if (ch.unicode() == 11) goto state_70; if (ch.unicode() == 12) - goto state_72; - if (ch.unicode() == 13) goto state_73; + if (ch.unicode() == 13) + goto state_72; if (ch.unicode() >= 14 && ch.unicode() <= 47) goto state_70; if (ch.unicode() >= 58 && ch.unicode() <= 96) @@ -535,13 +535,6 @@ int QCssScanner_Generated::lex() if (ch.unicode() >= 103) goto state_70; goto out; - state_43: - ch = next(); - if (ch.unicode() == 62) { - token = QCss::CDC; - goto found; - } - goto out; state_44: lastAcceptingPos = pos; token = QCss::NUMBER; @@ -549,15 +542,22 @@ int QCssScanner_Generated::lex() if (ch.unicode() == 37) goto state_46; if (ch.unicode() == 45) - goto state_47; + goto state_48; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_75; + goto state_74; if (ch.unicode() == 92) - goto state_50; + goto state_51; if (ch.unicode() == 95) - goto state_51; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_51; + goto state_50; + goto out; + state_45: + ch = next(); + if (ch.unicode() == 62) { + token = QCss::CDC; + goto found; + } goto out; state_46: lastAcceptingPos = pos; @@ -565,17 +565,17 @@ int QCssScanner_Generated::lex() goto out; state_47: ch = next(); - if (ch.unicode() == 92) - goto state_50; - if (ch.unicode() == 95) - goto state_51; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_51; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_44; goto out; state_48: ch = next(); - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_44; + if (ch.unicode() == 92) + goto state_51; + if (ch.unicode() == 95) + goto state_50; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_50; goto out; state_49: lastAcceptingPos = pos; @@ -584,45 +584,45 @@ int QCssScanner_Generated::lex() if (ch.unicode() == 37) goto state_46; if (ch.unicode() == 45) - goto state_47; - if (ch.unicode() == 46) goto state_48; + if (ch.unicode() == 46) + goto state_47; if (ch.unicode() >= 48 && ch.unicode() <= 57) goto state_49; if (ch.unicode() == 92) - goto state_50; + goto state_51; if (ch.unicode() == 95) - goto state_51; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_51; + goto state_50; goto out; state_50: - ch = next(); - if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_76; - if (ch.unicode() == 11) - goto state_76; - if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_76; - if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_76; - if (ch.unicode() >= 103) - goto state_76; - goto out; - state_51: lastAcceptingPos = pos; token = QCss::LENGTH; ch = next(); if (ch.unicode() == 45) - goto state_77; + goto state_76; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_77; + goto state_76; if (ch.unicode() == 92) - goto state_78; + goto state_77; if (ch.unicode() == 95) - goto state_77; + goto state_76; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_77; + goto state_76; + goto out; + state_51: + ch = next(); + if (ch.unicode() >= 1 && ch.unicode() <= 9) + goto state_78; + if (ch.unicode() == 11) + goto state_78; + if (ch.unicode() >= 14 && ch.unicode() <= 47) + goto state_78; + if (ch.unicode() >= 58 && ch.unicode() <= 96) + goto state_78; + if (ch.unicode() >= 103) + goto state_78; goto out; state_52: ch = next(); @@ -630,15 +630,27 @@ int QCssScanner_Generated::lex() goto state_79; goto out; state_53: - ch = next(); - if (ch.unicode() == 92) - goto state_54; - if (ch.unicode() == 95) - goto state_55; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_55; + lastAcceptingPos = pos; + token = QCss::FUNCTION; goto out; state_54: + lastAcceptingPos = pos; + token = QCss::IDENT; + ch = next(); + if (ch.unicode() == 40) + goto state_53; + if (ch.unicode() == 45) + goto state_54; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_54; + if (ch.unicode() == 92) + goto state_55; + if (ch.unicode() == 95) + goto state_54; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_54; + goto out; + state_55: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) goto state_80; @@ -651,7 +663,16 @@ int QCssScanner_Generated::lex() if (ch.unicode() >= 103) goto state_80; goto out; - state_55: + state_58: + ch = next(); + if (ch.unicode() == 92) + goto state_60; + if (ch.unicode() == 95) + goto state_59; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_59; + goto out; + state_59: lastAcceptingPos = pos; token = QCss::ATKEYWORD_SYM; ch = next(); @@ -666,44 +687,6 @@ int QCssScanner_Generated::lex() if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) goto state_81; goto out; - state_56: - lastAcceptingPos = pos; - token = QCss::IDENT; - ch = next(); - if (ch.unicode() == 40) - goto state_58; - if (ch.unicode() == 45) - goto state_59; - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_59; - if (ch.unicode() == 92) - goto state_60; - if (ch.unicode() == 95) - goto state_59; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_59; - goto out; - state_58: - lastAcceptingPos = pos; - token = QCss::FUNCTION; - goto out; - state_59: - lastAcceptingPos = pos; - token = QCss::IDENT; - ch = next(); - if (ch.unicode() == 40) - goto state_58; - if (ch.unicode() == 45) - goto state_59; - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_59; - if (ch.unicode() == 92) - goto state_60; - if (ch.unicode() == 95) - goto state_59; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_59; - goto out; state_60: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) @@ -717,74 +700,65 @@ int QCssScanner_Generated::lex() if (ch.unicode() >= 103) goto state_83; goto out; + state_62: + lastAcceptingPos = pos; + token = QCss::IDENT; + ch = next(); + if (ch.unicode() == 40) + goto state_53; + if (ch.unicode() == 45) + goto state_54; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_54; + if (ch.unicode() == 92) + goto state_55; + if (ch.unicode() == 95) + goto state_54; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_54; + goto out; state_63: lastAcceptingPos = pos; - token = QCss::INVALID; + token = QCss::HASH; ch = next(); - if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_33; - if (ch.unicode() == 11) - goto state_33; - if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_33; - if (ch.unicode() == 34) - goto state_34; - if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_33; + if (ch.unicode() == 45) + goto state_63; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_63; if (ch.unicode() == 92) - goto state_35; - if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_33; + goto state_64; + if (ch.unicode() == 95) + goto state_63; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_33; - if (ch.unicode() >= 123) - goto state_33; + goto state_63; goto out; state_64: - lastAcceptingPos = pos; - token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_33; + goto state_84; if (ch.unicode() == 11) - goto state_33; - if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_33; - if (ch.unicode() == 34) - goto state_34; - if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_33; - if (ch.unicode() == 92) - goto state_35; - if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_33; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_33; - if (ch.unicode() >= 123) - goto state_33; + goto state_84; + if (ch.unicode() >= 14 && ch.unicode() <= 47) + goto state_84; + if (ch.unicode() >= 58 && ch.unicode() <= 96) + goto state_84; + if (ch.unicode() >= 103) + goto state_84; goto out; state_65: lastAcceptingPos = pos; - token = QCss::INVALID; + token = QCss::HASH; ch = next(); - if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_33; - if (ch.unicode() == 11) - goto state_33; - if (ch.unicode() >= 14 && ch.unicode() <= 33) - goto state_33; - if (ch.unicode() == 34) - goto state_34; - if (ch.unicode() >= 35 && ch.unicode() <= 91) - goto state_33; + if (ch.unicode() == 45) + goto state_63; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_63; if (ch.unicode() == 92) - goto state_35; - if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_33; + goto state_64; + if (ch.unicode() == 95) + goto state_63; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_33; - if (ch.unicode() >= 123) - goto state_33; + goto state_63; goto out; state_66: lastAcceptingPos = pos; @@ -792,8 +766,6 @@ int QCssScanner_Generated::lex() ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) goto state_33; - if (ch.unicode() == 10) - goto state_84; if (ch.unicode() == 11) goto state_33; if (ch.unicode() >= 14 && ch.unicode() <= 33) @@ -813,189 +785,202 @@ int QCssScanner_Generated::lex() goto out; state_67: lastAcceptingPos = pos; - token = QCss::HASH; - ch = next(); - if (ch.unicode() == 45) - goto state_67; - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_67; - if (ch.unicode() == 92) - goto state_68; - if (ch.unicode() == 95) - goto state_67; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_67; - goto out; - state_68: + token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) + goto state_33; + if (ch.unicode() == 11) + goto state_33; + if (ch.unicode() >= 14 && ch.unicode() <= 33) + goto state_33; + if (ch.unicode() == 34) + goto state_34; + if (ch.unicode() >= 35 && ch.unicode() <= 91) + goto state_33; + if (ch.unicode() == 92) + goto state_35; + if (ch.unicode() >= 93 && ch.unicode() <= 96) + goto state_33; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_33; + if (ch.unicode() >= 123) + goto state_33; + goto out; + state_68: + lastAcceptingPos = pos; + token = QCss::INVALID; + ch = next(); + if (ch.unicode() >= 1 && ch.unicode() <= 9) + goto state_33; + if (ch.unicode() == 10) goto state_85; if (ch.unicode() == 11) - goto state_85; - if (ch.unicode() >= 14 && ch.unicode() <= 47) - goto state_85; - if (ch.unicode() >= 58 && ch.unicode() <= 96) - goto state_85; - if (ch.unicode() >= 103) - goto state_85; + goto state_33; + if (ch.unicode() >= 14 && ch.unicode() <= 33) + goto state_33; + if (ch.unicode() == 34) + goto state_34; + if (ch.unicode() >= 35 && ch.unicode() <= 91) + goto state_33; + if (ch.unicode() == 92) + goto state_35; + if (ch.unicode() >= 93 && ch.unicode() <= 96) + goto state_33; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_33; + if (ch.unicode() >= 123) + goto state_33; goto out; state_69: lastAcceptingPos = pos; - token = QCss::HASH; + token = QCss::INVALID; ch = next(); - if (ch.unicode() == 45) - goto state_67; - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_67; + if (ch.unicode() >= 1 && ch.unicode() <= 9) + goto state_33; + if (ch.unicode() == 11) + goto state_33; + if (ch.unicode() >= 14 && ch.unicode() <= 33) + goto state_33; + if (ch.unicode() == 34) + goto state_34; + if (ch.unicode() >= 35 && ch.unicode() <= 91) + goto state_33; if (ch.unicode() == 92) - goto state_68; - if (ch.unicode() == 95) - goto state_67; + goto state_35; + if (ch.unicode() >= 93 && ch.unicode() <= 96) + goto state_33; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_67; + goto state_33; + if (ch.unicode() >= 123) + goto state_33; goto out; state_70: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_39; + goto state_38; if (ch.unicode() == 11) - goto state_39; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_39; + goto state_38; if (ch.unicode() == 39) - goto state_40; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_39; + goto state_38; if (ch.unicode() == 92) - goto state_41; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_39; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_39; + goto state_38; if (ch.unicode() >= 123) - goto state_39; + goto state_38; goto out; state_71: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_39; + goto state_38; if (ch.unicode() == 11) - goto state_39; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_39; + goto state_38; if (ch.unicode() == 39) - goto state_40; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_39; + goto state_38; if (ch.unicode() == 92) - goto state_41; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_39; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_39; + goto state_38; if (ch.unicode() >= 123) - goto state_39; + goto state_38; goto out; state_72: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_39; + goto state_38; + if (ch.unicode() == 10) + goto state_86; if (ch.unicode() == 11) - goto state_39; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_39; + goto state_38; if (ch.unicode() == 39) - goto state_40; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_39; + goto state_38; if (ch.unicode() == 92) - goto state_41; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_39; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_39; + goto state_38; if (ch.unicode() >= 123) - goto state_39; + goto state_38; goto out; state_73: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_39; - if (ch.unicode() == 10) - goto state_86; + goto state_38; if (ch.unicode() == 11) - goto state_39; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_39; + goto state_38; if (ch.unicode() == 39) - goto state_40; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_39; + goto state_38; if (ch.unicode() == 92) - goto state_41; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_39; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_39; + goto state_38; if (ch.unicode() >= 123) - goto state_39; + goto state_38; goto out; - state_75: + state_74: lastAcceptingPos = pos; token = QCss::NUMBER; ch = next(); if (ch.unicode() == 37) goto state_46; if (ch.unicode() == 45) - goto state_47; + goto state_48; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_75; + goto state_74; if (ch.unicode() == 92) - goto state_50; + goto state_51; if (ch.unicode() == 95) - goto state_51; + goto state_50; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_51; + goto state_50; goto out; state_76: lastAcceptingPos = pos; token = QCss::LENGTH; ch = next(); if (ch.unicode() == 45) - goto state_77; + goto state_76; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_77; + goto state_76; if (ch.unicode() == 92) - goto state_78; + goto state_77; if (ch.unicode() == 95) - goto state_77; + goto state_76; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_77; + goto state_76; goto out; state_77: - lastAcceptingPos = pos; - token = QCss::LENGTH; - ch = next(); - if (ch.unicode() == 45) - goto state_77; - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_77; - if (ch.unicode() == 92) - goto state_78; - if (ch.unicode() == 95) - goto state_77; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_77; - goto out; - state_78: ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) goto state_87; @@ -1008,6 +993,21 @@ int QCssScanner_Generated::lex() if (ch.unicode() >= 103) goto state_87; goto out; + state_78: + lastAcceptingPos = pos; + token = QCss::LENGTH; + ch = next(); + if (ch.unicode() == 45) + goto state_76; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_76; + if (ch.unicode() == 92) + goto state_77; + if (ch.unicode() == 95) + goto state_76; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_76; + goto out; state_79: ch = next(); if (ch.unicode() == 45) { @@ -1017,18 +1017,20 @@ int QCssScanner_Generated::lex() goto out; state_80: lastAcceptingPos = pos; - token = QCss::ATKEYWORD_SYM; + token = QCss::IDENT; ch = next(); + if (ch.unicode() == 40) + goto state_53; if (ch.unicode() == 45) - goto state_81; + goto state_54; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_81; + goto state_54; if (ch.unicode() == 92) - goto state_82; + goto state_55; if (ch.unicode() == 95) - goto state_81; + goto state_54; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_81; + goto state_54; goto out; state_81: lastAcceptingPos = pos; @@ -1060,22 +1062,35 @@ int QCssScanner_Generated::lex() goto out; state_83: lastAcceptingPos = pos; - token = QCss::IDENT; + token = QCss::ATKEYWORD_SYM; ch = next(); - if (ch.unicode() == 40) - goto state_58; if (ch.unicode() == 45) - goto state_59; + goto state_81; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_59; + goto state_81; if (ch.unicode() == 92) - goto state_60; + goto state_82; if (ch.unicode() == 95) - goto state_59; + goto state_81; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_59; + goto state_81; goto out; state_84: + lastAcceptingPos = pos; + token = QCss::HASH; + ch = next(); + if (ch.unicode() == 45) + goto state_63; + if (ch.unicode() >= 48 && ch.unicode() <= 57) + goto state_63; + if (ch.unicode() == 92) + goto state_64; + if (ch.unicode() == 95) + goto state_63; + if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) + goto state_63; + goto out; + state_85: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); @@ -1098,58 +1113,43 @@ int QCssScanner_Generated::lex() if (ch.unicode() >= 123) goto state_33; goto out; - state_85: - lastAcceptingPos = pos; - token = QCss::HASH; - ch = next(); - if (ch.unicode() == 45) - goto state_67; - if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_67; - if (ch.unicode() == 92) - goto state_68; - if (ch.unicode() == 95) - goto state_67; - if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_67; - goto out; state_86: lastAcceptingPos = pos; token = QCss::INVALID; ch = next(); if (ch.unicode() >= 1 && ch.unicode() <= 9) - goto state_39; + goto state_38; if (ch.unicode() == 11) - goto state_39; + goto state_38; if (ch.unicode() >= 14 && ch.unicode() <= 38) - goto state_39; + goto state_38; if (ch.unicode() == 39) - goto state_40; + goto state_39; if (ch.unicode() >= 40 && ch.unicode() <= 91) - goto state_39; + goto state_38; if (ch.unicode() == 92) - goto state_41; + goto state_40; if (ch.unicode() >= 93 && ch.unicode() <= 96) - goto state_39; + goto state_38; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_39; + goto state_38; if (ch.unicode() >= 123) - goto state_39; + goto state_38; goto out; state_87: lastAcceptingPos = pos; token = QCss::LENGTH; ch = next(); if (ch.unicode() == 45) - goto state_77; + goto state_76; if (ch.unicode() >= 48 && ch.unicode() <= 57) - goto state_77; + goto state_76; if (ch.unicode() == 92) - goto state_78; + goto state_77; if (ch.unicode() == 95) - goto state_77; + goto state_76; if ((ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256) - goto state_77; + goto state_76; goto out; state_89: lastAcceptingPos = pos; @@ -1176,4 +1176,3 @@ int QCssScanner_Generated::lex() } return token; } - diff --git a/util/lexgen/README b/util/lexgen/README index 435c7f31ee0..005b77b81c8 100644 --- a/util/lexgen/README +++ b/util/lexgen/README @@ -11,6 +11,5 @@ you want. But I like that it generates code that operates on QChar and friends. Use at your own risk ;-) - -- -Simon Hausmann +Simon Hausmann diff --git a/util/lexgen/css3-simplified.lexgen b/util/lexgen/css3-simplified.lexgen index 99463d524ed..d86a4786bea 100644 --- a/util/lexgen/css3-simplified.lexgen +++ b/util/lexgen/css3-simplified.lexgen @@ -5,7 +5,7 @@ classname = QCssScanner_Generated [Code Generator Options] MapToCode[a-z] = (ch.unicode() >= 'a' && ch.unicode() <= 'z') || (ch.unicode() >= 'A' && ch.unicode() <= 'Z') || ch.unicode() >= 256 TokenPrefix = QCss:: -FileHeader = ../../src/tools/moc/util/licenseheader.txt +FileHeader = ../../header.LGPL [Macros] escape = \\[^\r\n\f0-9a-f] diff --git a/util/lexgen/generator.cpp b/util/lexgen/generator.cpp index edd2b603e73..481d586e730 100644 --- a/util/lexgen/generator.cpp +++ b/util/lexgen/generator.cpp @@ -29,6 +29,7 @@ #include "generator.h" #include +#include void Function::printDeclaration(CodeBlock &block, const QString &funcNamePrefix) const { @@ -505,14 +506,16 @@ QString Generator::generate() klass.addMember(Class::PublicMember, lexFunc); QString header; - QFile headerFile(headerFileName); - if (!headerFileName.isEmpty() - && headerFile.exists() - && headerFile.open(QIODevice::ReadOnly)) { - header = QString::fromUtf8(headerFile.readAll()); + if (!headerFileName.isEmpty()) { + QString self(QDir::fromNativeSeparators(QStringLiteral(__FILE__))); + int lastSep = self.lastIndexOf(QChar('/')); + QDir here(lastSep < 0 ? QStringLiteral(".") : self.left(lastSep)); + QFile headerFile(QDir::cleanPath(here.filePath(headerFileName))); + if (headerFile.exists() && headerFile.open(QIODevice::ReadOnly)) + header = QString::fromUtf8(headerFile.readAll()); } - header += QLatin1String("// auto generated. DO NOT EDIT.\n"); + header += QLatin1String("// auto generated by qtbase/util/lexgen/. DO NOT EDIT.\n"); return header + klass.declaration() + klass.definition(); } diff --git a/util/lexgen/main.cpp b/util/lexgen/main.cpp index 22b99b633c8..517629f4c1a 100644 --- a/util/lexgen/main.cpp +++ b/util/lexgen/main.cpp @@ -256,7 +256,7 @@ int main(int argc, char **argv) } if (ruleFile.isEmpty()) { - qWarning("usage: lexgen [-test rulefile"); + qWarning("usage: lexgen [-debug] [-cache] [-test] rulefile"); qWarning(" "); qWarning(" the -test option will cause lexgen to interpret standard input"); qWarning(" according to the specified rules and print out pairs of token and");