home *** CD-ROM | disk | FTP | other *** search
/ Computer Active Guide 2009 July / CAG7.ISO / Internetas / SafariSetup.exe / AppleApplicationSupport.msi / WebKit.resources_inspector_SourceHTMLTokenizer.js < prev    next >
Encoding:
Text File  |  2010-06-03  |  26.4 KB  |  688 lines

  1. /* Generated by re2c 0.13.5 on Thu Feb 25 21:44:55 2010 */
  2. /*
  3.  * Copyright (C) 2009 Google Inc. All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions are
  7.  * met:
  8.  *
  9.  *     * Redistributions of source code must retain the above copyright
  10.  * notice, this list of conditions and the following disclaimer.
  11.  *     * Redistributions in binary form must reproduce the above
  12.  * copyright notice, this list of conditions and the following disclaimer
  13.  * in the documentation and/or other materials provided with the
  14.  * distribution.
  15.  *     * Neither the name of Google Inc. nor the names of its
  16.  * contributors may be used to endorse or promote products derived from
  17.  * this software without specific prior written permission.
  18.  *
  19.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20.  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21.  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  22.  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  23.  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  24.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  25.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26.  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27.  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29.  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30.  */
  31.  
  32. // Generate js file as follows:
  33. //
  34. // re2c -isc WebCore/inspector/front-end/SourceHTMLTokenizer.re2js \
  35. // | sed 's|^yy\([^:]*\)*\:|case \1:|' \
  36. // | sed 's|[*]cursor[+][+]|this._charAt(cursor++)|' \
  37. // | sed 's|[[*][+][+]cursor|this._charAt(++cursor)|' \
  38. // | sed 's|[*]cursor|this._charAt(cursor)|' \
  39. // | sed 's|yych = \*\([^;]*\)|yych = this._charAt\1|' \
  40. // | sed 's|{ gotoCase = \([^; continue; };]*\)|{ gotoCase = \1; continue; }|' \
  41. // | sed 's|unsigned\ int|var|' \
  42. // | sed 's|var\ yych|case 1: case 1: var yych|'
  43.  
  44. WebInspector.SourceHTMLTokenizer = function()
  45. {
  46.     WebInspector.SourceTokenizer.call(this);
  47.  
  48.     // The order is determined by the generated code.
  49.     this._lexConditions = {
  50.         INITIAL: 0,
  51.         COMMENT: 1,
  52.         DOCTYPE: 2,
  53.         TAG: 3,
  54.         DSTRING: 4,
  55.         SSTRING: 5
  56.     };
  57.     this.case_INITIAL = 1000;
  58.     this.case_COMMENT = 1001;
  59.     this.case_DOCTYPE = 1002;
  60.     this.case_TAG = 1003;
  61.     this.case_DSTRING = 1004;
  62.     this.case_SSTRING = 1005;
  63.  
  64.     this._parseConditions = {
  65.         INITIAL: 0,
  66.         ATTRIBUTE: 1,
  67.         ATTRIBUTE_VALUE: 2,
  68.         LINKIFY: 4,
  69.         A_NODE: 8,
  70.         SCRIPT: 16
  71.     };
  72.  
  73.     this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
  74.     this.condition = this.initialCondition;
  75. }
  76.  
  77. WebInspector.SourceHTMLTokenizer.prototype = {
  78.     set line(line) {
  79.         if (this._internalJavaScriptTokenizer) {
  80.             var match = /<\/script/i.exec(line);
  81.             if (match) {
  82.                 this._internalJavaScriptTokenizer.line = line.substring(0, match.index);
  83.             } else
  84.                 this._internalJavaScriptTokenizer.line = line;
  85.         }
  86.         this._line = line;
  87.     },
  88.  
  89.     _isExpectingAttribute: function()
  90.     {
  91.         return this._condition.parseCondition & this._parseConditions.ATTRIBUTE;
  92.     },
  93.  
  94.     _isExpectingAttributeValue: function()
  95.     {
  96.         return this._condition.parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
  97.     },
  98.  
  99.     _setExpectingAttribute: function()
  100.     {
  101.         if (this._isExpectingAttributeValue())
  102.             this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
  103.         this._condition.parseCondition |= this._parseConditions.ATTRIBUTE;
  104.     },
  105.  
  106.     _setExpectingAttributeValue: function()
  107.     {
  108.         if (this._isExpectingAttribute())
  109.             this._condition.parseCondition ^= this._parseConditions.ATTRIBUTE;
  110.         this._condition.parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
  111.     },
  112.  
  113.     _stringToken: function(cursor, stringEnds)
  114.     {
  115.         if (!this._isExpectingAttributeValue()) {
  116.             this.tokenType = null;
  117.             return cursor;
  118.         }
  119.         this.tokenType = this._attrValueTokenType();
  120.         if (stringEnds)
  121.             this._setExpectingAttribute();
  122.         return cursor;
  123.     },
  124.  
  125.     _attrValueTokenType: function()
  126.     {
  127.         if (this._condition.parseCondition & this._parseConditions.LINKIFY) {
  128.             if (this._condition.parseCondition & this._parseConditions.A_NODE)
  129.                 return "html-external-link";
  130.             return "html-resource-link";
  131.         }
  132.         return "html-attribute-value";
  133.     },
  134.  
  135.     nextToken: function(cursor)
  136.     {
  137.         if (this._internalJavaScriptTokenizer) {
  138.             // Re-set line to force </script> detection first.
  139.             this.line = this._line;
  140.             if (cursor !== this._internalJavaScriptTokenizer._line.length) {
  141.                 // Tokenizer is stateless, so restore its condition before tokenizing and save it after.
  142.                 this._internalJavaScriptTokenizer.condition = this._condition.internalJavaScriptTokenizerCondition;
  143.                 var result = this._internalJavaScriptTokenizer.nextToken(cursor);
  144.                 this.tokenType = this._internalJavaScriptTokenizer.tokenType;
  145.                 this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.condition;
  146.                 return result;
  147.             } else if (cursor !== this._line.length)
  148.                 delete this._internalJavaScriptTokenizer;
  149.         }
  150.  
  151.         var cursorOnEnter = cursor;
  152.         var gotoCase = 1;
  153.         while (1) {
  154.             switch (gotoCase)
  155.             // Following comment is replaced with generated state machine.
  156.             
  157.         {
  158.             case 1: var yych;
  159.             var yyaccept = 0;
  160.             if (this.getLexCondition() < 3) {
  161.                 if (this.getLexCondition() < 1) {
  162.                     { gotoCase = this.case_INITIAL; continue; };
  163.                 } else {
  164.                     if (this.getLexCondition() < 2) {
  165.                         { gotoCase = this.case_COMMENT; continue; };
  166.                     } else {
  167.                         { gotoCase = this.case_DOCTYPE; continue; };
  168.                     }
  169.                 }
  170.             } else {
  171.                 if (this.getLexCondition() < 4) {
  172.                     { gotoCase = this.case_TAG; continue; };
  173.                 } else {
  174.                     if (this.getLexCondition() < 5) {
  175.                         { gotoCase = this.case_DSTRING; continue; };
  176.                     } else {
  177.                         { gotoCase = this.case_SSTRING; continue; };
  178.                     }
  179.                 }
  180.             }
  181. /* *********************************** */
  182. case this.case_COMMENT:
  183.  
  184.             yych = this._charAt(cursor);
  185.             if (yych <= '\f') {
  186.                 if (yych == '\n') { gotoCase = 4; continue; };
  187.                 { gotoCase = 3; continue; };
  188.             } else {
  189.                 if (yych <= '\r') { gotoCase = 4; continue; };
  190.                 if (yych == '-') { gotoCase = 6; continue; };
  191.                 { gotoCase = 3; continue; };
  192.             }
  193. case 2:
  194.             { this.tokenType = "html-comment"; return cursor; }
  195. case 3:
  196.             yyaccept = 0;
  197.             yych = this._charAt(YYMARKER = ++cursor);
  198.             { gotoCase = 9; continue; };
  199. case 4:
  200.             ++cursor;
  201. case 5:
  202.             { this.tokenType = null; return cursor; }
  203. case 6:
  204.             yyaccept = 1;
  205.             yych = this._charAt(YYMARKER = ++cursor);
  206.             if (yych != '-') { gotoCase = 5; continue; };
  207. case 7:
  208.             ++cursor;
  209.             yych = this._charAt(cursor);
  210.             if (yych == '>') { gotoCase = 10; continue; };
  211. case 8:
  212.             yyaccept = 0;
  213.             YYMARKER = ++cursor;
  214.             yych = this._charAt(cursor);
  215. case 9:
  216.             if (yych <= '\f') {
  217.                 if (yych == '\n') { gotoCase = 2; continue; };
  218.                 { gotoCase = 8; continue; };
  219.             } else {
  220.                 if (yych <= '\r') { gotoCase = 2; continue; };
  221.                 if (yych == '-') { gotoCase = 12; continue; };
  222.                 { gotoCase = 8; continue; };
  223.             }
  224. case 10:
  225.             ++cursor;
  226.             this.setLexCondition(this._lexConditions.INITIAL);
  227.             { this.tokenType = "html-comment"; return cursor; }
  228. case 12:
  229.             ++cursor;
  230.             yych = this._charAt(cursor);
  231.             if (yych == '-') { gotoCase = 7; continue; };
  232.             cursor = YYMARKER;
  233.             if (yyaccept <= 0) {
  234.                 { gotoCase = 2; continue; };
  235.             } else {
  236.                 { gotoCase = 5; continue; };
  237.             }
  238. /* *********************************** */
  239. case this.case_DOCTYPE:
  240.             yych = this._charAt(cursor);
  241.             if (yych <= '\f') {
  242.                 if (yych == '\n') { gotoCase = 18; continue; };
  243.                 { gotoCase = 17; continue; };
  244.             } else {
  245.                 if (yych <= '\r') { gotoCase = 18; continue; };
  246.                 if (yych == '>') { gotoCase = 20; continue; };
  247.                 { gotoCase = 17; continue; };
  248.             }
  249. case 16:
  250.             { this.tokenType = "html-doctype"; return cursor; }
  251. case 17:
  252.             yych = this._charAt(++cursor);
  253.             { gotoCase = 23; continue; };
  254. case 18:
  255.             ++cursor;
  256.             { this.tokenType = null; return cursor; }
  257. case 20:
  258.             ++cursor;
  259.             this.setLexCondition(this._lexConditions.INITIAL);
  260.             { this.tokenType = "html-doctype"; return cursor; }
  261. case 22:
  262.             ++cursor;
  263.             yych = this._charAt(cursor);
  264. case 23:
  265.             if (yych <= '\f') {
  266.                 if (yych == '\n') { gotoCase = 16; continue; };
  267.                 { gotoCase = 22; continue; };
  268.             } else {
  269.                 if (yych <= '\r') { gotoCase = 16; continue; };
  270.                 if (yych == '>') { gotoCase = 16; continue; };
  271.                 { gotoCase = 22; continue; };
  272.             }
  273. /* *********************************** */
  274. case this.case_DSTRING:
  275.             yych = this._charAt(cursor);
  276.             if (yych <= '\f') {
  277.                 if (yych == '\n') { gotoCase = 28; continue; };
  278.                 { gotoCase = 27; continue; };
  279.             } else {
  280.                 if (yych <= '\r') { gotoCase = 28; continue; };
  281.                 if (yych == '"') { gotoCase = 30; continue; };
  282.                 { gotoCase = 27; continue; };
  283.             }
  284. case 26:
  285.             { return this._stringToken(cursor); }
  286. case 27:
  287.             yych = this._charAt(++cursor);
  288.             { gotoCase = 34; continue; };
  289. case 28:
  290.             ++cursor;
  291.             { this.tokenType = null; return cursor; }
  292. case 30:
  293.             ++cursor;
  294. case 31:
  295.             this.setLexCondition(this._lexConditions.TAG);
  296.             { return this._stringToken(cursor, true); }
  297. case 32:
  298.             yych = this._charAt(++cursor);
  299.             { gotoCase = 31; continue; };
  300. case 33:
  301.             ++cursor;
  302.             yych = this._charAt(cursor);
  303. case 34:
  304.             if (yych <= '\f') {
  305.                 if (yych == '\n') { gotoCase = 26; continue; };
  306.                 { gotoCase = 33; continue; };
  307.             } else {
  308.                 if (yych <= '\r') { gotoCase = 26; continue; };
  309.                 if (yych == '"') { gotoCase = 32; continue; };
  310.                 { gotoCase = 33; continue; };
  311.             }
  312. /* *********************************** */
  313. case this.case_INITIAL:
  314.             yych = this._charAt(cursor);
  315.             if (yych == '<') { gotoCase = 39; continue; };
  316.             ++cursor;
  317.             { this.tokenType = null; return cursor; }
  318. case 39:
  319.             yyaccept = 0;
  320.             yych = this._charAt(YYMARKER = ++cursor);
  321.             if (yych <= '/') {
  322.                 if (yych == '!') { gotoCase = 44; continue; };
  323.                 if (yych >= '/') { gotoCase = 41; continue; };
  324.             } else {
  325.                 if (yych <= 'S') {
  326.                     if (yych >= 'S') { gotoCase = 42; continue; };
  327.                 } else {
  328.                     if (yych == 's') { gotoCase = 42; continue; };
  329.                 }
  330.             }
  331. case 40:
  332.             this.setLexCondition(this._lexConditions.TAG);
  333.             {
  334.                     if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
  335.                         // Do not tokenize script tag contents, keep lexer state although processing "<".
  336.                         this.setLexCondition(this._lexConditions.INITIAL);
  337.                         this.tokenType = null;
  338.                         return cursor;
  339.                     }
  340.  
  341.                     this._condition.parseCondition = this._parseConditions.INITIAL;
  342.                     this.tokenType = "html-tag";
  343.                     return cursor;
  344.                 }
  345. case 41:
  346.             yyaccept = 0;
  347.             yych = this._charAt(YYMARKER = ++cursor);
  348.             if (yych == 'S') { gotoCase = 68; continue; };
  349.             if (yych == 's') { gotoCase = 68; continue; };
  350.             { gotoCase = 40; continue; };
  351. case 42:
  352.             yych = this._charAt(++cursor);
  353.             if (yych == 'C') { gotoCase = 62; continue; };
  354.             if (yych == 'c') { gotoCase = 62; continue; };
  355. case 43:
  356.             cursor = YYMARKER;
  357.             { gotoCase = 40; continue; };
  358. case 44:
  359.             yych = this._charAt(++cursor);
  360.             if (yych <= 'C') {
  361.                 if (yych != '-') { gotoCase = 43; continue; };
  362.             } else {
  363.                 if (yych <= 'D') { gotoCase = 46; continue; };
  364.                 if (yych == 'd') { gotoCase = 46; continue; };
  365.                 { gotoCase = 43; continue; };
  366.             }
  367.             yych = this._charAt(++cursor);
  368.             if (yych == '-') { gotoCase = 54; continue; };
  369.             { gotoCase = 43; continue; };
  370. case 46:
  371.             yych = this._charAt(++cursor);
  372.             if (yych == 'O') { gotoCase = 47; continue; };
  373.             if (yych != 'o') { gotoCase = 43; continue; };
  374. case 47:
  375.             yych = this._charAt(++cursor);
  376.             if (yych == 'C') { gotoCase = 48; continue; };
  377.             if (yych != 'c') { gotoCase = 43; continue; };
  378. case 48:
  379.             yych = this._charAt(++cursor);
  380.             if (yych == 'T') { gotoCase = 49; continue; };
  381.             if (yych != 't') { gotoCase = 43; continue; };
  382. case 49:
  383.             yych = this._charAt(++cursor);
  384.             if (yych == 'Y') { gotoCase = 50; continue; };
  385.             if (yych != 'y') { gotoCase = 43; continue; };
  386. case 50:
  387.             yych = this._charAt(++cursor);
  388.             if (yych == 'P') { gotoCase = 51; continue; };
  389.             if (yych != 'p') { gotoCase = 43; continue; };
  390. case 51:
  391.             yych = this._charAt(++cursor);
  392.             if (yych == 'E') { gotoCase = 52; continue; };
  393.             if (yych != 'e') { gotoCase = 43; continue; };
  394. case 52:
  395.             ++cursor;
  396.             this.setLexCondition(this._lexConditions.DOCTYPE);
  397.             { this.tokenType = "html-doctype"; return cursor; }
  398. case 54:
  399.             ++cursor;
  400.             yych = this._charAt(cursor);
  401.             if (yych <= '\f') {
  402.                 if (yych == '\n') { gotoCase = 57; continue; };
  403.                 { gotoCase = 54; continue; };
  404.             } else {
  405.                 if (yych <= '\r') { gotoCase = 57; continue; };
  406.                 if (yych != '-') { gotoCase = 54; continue; };
  407.             }
  408.             ++cursor;
  409.             yych = this._charAt(cursor);
  410.             if (yych == '-') { gotoCase = 59; continue; };
  411.             { gotoCase = 43; continue; };
  412. case 57:
  413.             ++cursor;
  414.             this.setLexCondition(this._lexConditions.COMMENT);
  415.             { this.tokenType = "html-comment"; return cursor; }
  416. case 59:
  417.             ++cursor;
  418.             yych = this._charAt(cursor);
  419.             if (yych != '>') { gotoCase = 54; continue; };
  420.             ++cursor;
  421.             { this.tokenType = "html-comment"; return cursor; }
  422. case 62:
  423.             yych = this._charAt(++cursor);
  424.             if (yych == 'R') { gotoCase = 63; continue; };
  425.             if (yych != 'r') { gotoCase = 43; continue; };
  426. case 63:
  427.             yych = this._charAt(++cursor);
  428.             if (yych == 'I') { gotoCase = 64; continue; };
  429.             if (yych != 'i') { gotoCase = 43; continue; };
  430. case 64:
  431.             yych = this._charAt(++cursor);
  432.             if (yych == 'P') { gotoCase = 65; continue; };
  433.             if (yych != 'p') { gotoCase = 43; continue; };
  434. case 65:
  435.             yych = this._charAt(++cursor);
  436.             if (yych == 'T') { gotoCase = 66; continue; };
  437.             if (yych != 't') { gotoCase = 43; continue; };
  438. case 66:
  439.             ++cursor;
  440.             this.setLexCondition(this._lexConditions.TAG);
  441.             {
  442.                     if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
  443.                         // Do not tokenize script tag contents, keep lexer state although processing "<".
  444.                         this.setLexCondition(this._lexConditions.INITIAL);
  445.                         this.tokenType = null;
  446.                         return cursor;
  447.                     }
  448.                     this.tokenType = "html-tag";
  449.                     this._condition.parseCondition = this._parseConditions.SCRIPT;
  450.                     this._setExpectingAttribute();
  451.                     return cursor;
  452.                 }
  453. case 68:
  454.             yych = this._charAt(++cursor);
  455.             if (yych == 'C') { gotoCase = 69; continue; };
  456.             if (yych != 'c') { gotoCase = 43; continue; };
  457. case 69:
  458.             yych = this._charAt(++cursor);
  459.             if (yych == 'R') { gotoCase = 70; continue; };
  460.             if (yych != 'r') { gotoCase = 43; continue; };
  461. case 70:
  462.             yych = this._charAt(++cursor);
  463.             if (yych == 'I') { gotoCase = 71; continue; };
  464.             if (yych != 'i') { gotoCase = 43; continue; };
  465. case 71:
  466.             yych = this._charAt(++cursor);
  467.             if (yych == 'P') { gotoCase = 72; continue; };
  468.             if (yych != 'p') { gotoCase = 43; continue; };
  469. case 72:
  470.             yych = this._charAt(++cursor);
  471.             if (yych == 'T') { gotoCase = 73; continue; };
  472.             if (yych != 't') { gotoCase = 43; continue; };
  473. case 73:
  474.             ++cursor;
  475.             this.setLexCondition(this._lexConditions.TAG);
  476.             {
  477.                     this.tokenType = "html-tag";
  478.                     this._condition.parseCondition = this._parseConditions.INITIAL;
  479.                     return cursor;
  480.                 }
  481. /* *********************************** */
  482. case this.case_SSTRING:
  483.             yych = this._charAt(cursor);
  484.             if (yych <= '\f') {
  485.                 if (yych == '\n') { gotoCase = 79; continue; };
  486.                 { gotoCase = 78; continue; };
  487.             } else {
  488.                 if (yych <= '\r') { gotoCase = 79; continue; };
  489.                 if (yych == '\'') { gotoCase = 81; continue; };
  490.                 { gotoCase = 78; continue; };
  491.             }
  492. case 77:
  493.             { return this._stringToken(cursor); }
  494. case 78:
  495.             yych = this._charAt(++cursor);
  496.             { gotoCase = 85; continue; };
  497. case 79:
  498.             ++cursor;
  499.             { this.tokenType = null; return cursor; }
  500. case 81:
  501.             ++cursor;
  502. case 82:
  503.             this.setLexCondition(this._lexConditions.TAG);
  504.             { return this._stringToken(cursor, true); }
  505. case 83:
  506.             yych = this._charAt(++cursor);
  507.             { gotoCase = 82; continue; };
  508. case 84:
  509.             ++cursor;
  510.             yych = this._charAt(cursor);
  511. case 85:
  512.             if (yych <= '\f') {
  513.                 if (yych == '\n') { gotoCase = 77; continue; };
  514.                 { gotoCase = 84; continue; };
  515.             } else {
  516.                 if (yych <= '\r') { gotoCase = 77; continue; };
  517.                 if (yych == '\'') { gotoCase = 83; continue; };
  518.                 { gotoCase = 84; continue; };
  519.             }
  520. /* *********************************** */
  521. case this.case_TAG:
  522.             yych = this._charAt(cursor);
  523.             if (yych <= '&') {
  524.                 if (yych <= '\r') {
  525.                     if (yych == '\n') { gotoCase = 90; continue; };
  526.                     if (yych >= '\r') { gotoCase = 90; continue; };
  527.                 } else {
  528.                     if (yych <= ' ') {
  529.                         if (yych >= ' ') { gotoCase = 90; continue; };
  530.                     } else {
  531.                         if (yych == '"') { gotoCase = 92; continue; };
  532.                     }
  533.                 }
  534.             } else {
  535.                 if (yych <= '>') {
  536.                     if (yych <= ';') {
  537.                         if (yych <= '\'') { gotoCase = 93; continue; };
  538.                     } else {
  539.                         if (yych <= '<') { gotoCase = 90; continue; };
  540.                         if (yych <= '=') { gotoCase = 94; continue; };
  541.                         { gotoCase = 96; continue; };
  542.                     }
  543.                 } else {
  544.                     if (yych <= '[') {
  545.                         if (yych >= '[') { gotoCase = 90; continue; };
  546.                     } else {
  547.                         if (yych == ']') { gotoCase = 90; continue; };
  548.                     }
  549.                 }
  550.             }
  551.             ++cursor;
  552.             yych = this._charAt(cursor);
  553.             { gotoCase = 109; continue; };
  554. case 89:
  555.             {
  556.                     if (this._condition.parseCondition === this._parseConditions.SCRIPT) {
  557.                         // Fall through if expecting attributes.
  558.                         this.tokenType = null;
  559.                         return cursor;
  560.                     }
  561.  
  562.                     if (this._condition.parseCondition === this._parseConditions.INITIAL) {
  563.                         this.tokenType = "html-tag";
  564.                         this._setExpectingAttribute();
  565.                         var token = this._line.substring(cursorOnEnter, cursor);
  566.                         if (token === "a")
  567.                             this._condition.parseCondition |= this._parseConditions.A_NODE;
  568.                         else if (this._condition.parseCondition & this._parseConditions.A_NODE)
  569.                             this._condition.parseCondition ^= this._parseConditions.A_NODE;
  570.                     } else if (this._isExpectingAttribute()) {
  571.                         var token = this._line.substring(cursorOnEnter, cursor);
  572.                         if (token === "href" || token === "src")
  573.                             this._condition.parseCondition |= this._parseConditions.LINKIFY;
  574.                         else if (this._condition.parseCondition |= this._parseConditions.LINKIFY)
  575.                             this._condition.parseCondition ^= this._parseConditions.LINKIFY;
  576.                         this.tokenType = "html-attribute-name";
  577.                     } else if (this._isExpectingAttributeValue())
  578.                         this.tokenType = this._attrValueTokenType();
  579.                     else
  580.                         this.tokenType = null;
  581.                     return cursor;
  582.                 }
  583. case 90:
  584.             ++cursor;
  585.             { this.tokenType = null; return cursor; }
  586. case 92:
  587.             yyaccept = 0;
  588.             yych = this._charAt(YYMARKER = ++cursor);
  589.             { gotoCase = 105; continue; };
  590. case 93:
  591.             yyaccept = 0;
  592.             yych = this._charAt(YYMARKER = ++cursor);
  593.             { gotoCase = 99; continue; };
  594. case 94:
  595.             ++cursor;
  596.             {
  597.                     if (this._isExpectingAttribute())
  598.                         this._setExpectingAttributeValue();
  599.                     this.tokenType = null;
  600.                     return cursor;
  601.                 }
  602. case 96:
  603.             ++cursor;
  604.             this.setLexCondition(this._lexConditions.INITIAL);
  605.             {
  606.                     this.tokenType = "html-tag";
  607.                     if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
  608.                         if (!this._internalJavaScriptTokenizer) {
  609.                             this._internalJavaScriptTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/javascript");
  610.                             this._condition.internalJavaScriptTokenizerCondition = this._internalJavaScriptTokenizer.initialCondition;
  611.                         }
  612.                         // Do not tokenize script tag contents.
  613.                         return cursor;
  614.                     }
  615.  
  616.                     this._condition.parseCondition = this._parseConditions.INITIAL;
  617.                     return cursor;
  618.                 }
  619. case 98:
  620.             ++cursor;
  621.             yych = this._charAt(cursor);
  622. case 99:
  623.             if (yych <= '\f') {
  624.                 if (yych != '\n') { gotoCase = 98; continue; };
  625.             } else {
  626.                 if (yych <= '\r') { gotoCase = 100; continue; };
  627.                 if (yych == '\'') { gotoCase = 102; continue; };
  628.                 { gotoCase = 98; continue; };
  629.             }
  630. case 100:
  631.             ++cursor;
  632.             this.setLexCondition(this._lexConditions.SSTRING);
  633.             { return this._stringToken(cursor); }
  634. case 102:
  635.             ++cursor;
  636.             { return this._stringToken(cursor, true); }
  637. case 104:
  638.             ++cursor;
  639.             yych = this._charAt(cursor);
  640. case 105:
  641.             if (yych <= '\f') {
  642.                 if (yych != '\n') { gotoCase = 104; continue; };
  643.             } else {
  644.                 if (yych <= '\r') { gotoCase = 106; continue; };
  645.                 if (yych == '"') { gotoCase = 102; continue; };
  646.                 { gotoCase = 104; continue; };
  647.             }
  648. case 106:
  649.             ++cursor;
  650.             this.setLexCondition(this._lexConditions.DSTRING);
  651.             { return this._stringToken(cursor); }
  652. case 108:
  653.             ++cursor;
  654.             yych = this._charAt(cursor);
  655. case 109:
  656.             if (yych <= '"') {
  657.                 if (yych <= '\r') {
  658.                     if (yych == '\n') { gotoCase = 89; continue; };
  659.                     if (yych <= '\f') { gotoCase = 108; continue; };
  660.                     { gotoCase = 89; continue; };
  661.                 } else {
  662.                     if (yych == ' ') { gotoCase = 89; continue; };
  663.                     if (yych <= '!') { gotoCase = 108; continue; };
  664.                     { gotoCase = 89; continue; };
  665.                 }
  666.             } else {
  667.                 if (yych <= '>') {
  668.                     if (yych == '\'') { gotoCase = 89; continue; };
  669.                     if (yych <= ';') { gotoCase = 108; continue; };
  670.                     { gotoCase = 89; continue; };
  671.                 } else {
  672.                     if (yych <= '[') {
  673.                         if (yych <= 'Z') { gotoCase = 108; continue; };
  674.                         { gotoCase = 89; continue; };
  675.                     } else {
  676.                         if (yych == ']') { gotoCase = 89; continue; };
  677.                         { gotoCase = 108; continue; };
  678.                     }
  679.                 }
  680.             }
  681.         }
  682.  
  683.         }
  684.     }
  685. }
  686.  
  687. WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
  688.