<lexer>
  <config>
    <name>lox</name>
    <filename>*.lox</filename>
    <dot_all>true</dot_all>
    <ensure_nl>true</ensure_nl>
  </config>
  <rules>
    <state name="classname">
      <rule pattern="[a-zA-Z_]\w*">
        <token type="NameClass"/>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="funname">
      <rule pattern="[a-zA-Z_]\w*">
        <token type="NameFunction"/>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="varname">
      <rule pattern="[a-zA-Z_]\w*">
        <token type="NameVariable"/>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="whitespace">
      <rule pattern="\n">
        <token type="Text"/>
      </rule>
      <rule pattern="\s+">
        <token type="Text"/>
      </rule>
    </state>
    <state name="root">
      <rule>
        <include state="whitespace"/>
      </rule>
      <rule pattern="//.*?\n">
        <token type="CommentSingle"/>
      </rule>
      <rule pattern="(and|else|for|if|or|print|return|super|this|while)\b">
        <token type="Keyword"/>
      </rule>
      <rule pattern="(false|nil|true)\b">
        <token type="KeywordConstant"/>
      </rule>
      <rule pattern="(class)(\s*)">
        <token type="KeywordDeclaration"/>
        <push state="classname"/>
      </rule>
      <rule pattern="(fun)(\s*)">
        <token type="KeywordDeclaration"/>
        <push state="funname"/>
      </rule>
      <rule pattern="(var)(\s*)">
        <token type="KeywordDeclaration"/>
        <push state="varname"/>
      </rule>
      <rule pattern="\d+(\.\d*|[eE][+\-]?\d+)">
        <token type="LiteralNumberFloat"/>
      </rule>
      <rule pattern="[0-9][0-9]*">
        <token type="LiteralNumberInteger"/>
      </rule>
      <rule pattern="&#34;(\\\\|\\&#34;|[^&#34;])*&#34;">
        <token type="LiteralStringDouble"/>
      </rule>
      <rule pattern="!|\+|-|\*|/|&lt;|&gt;|=">
        <token type="Operator"/>
      </rule>
      <rule pattern="[{(;,]">
        <token type="Punctuation"/>
      </rule>
      <rule pattern="[}).]">
        <token type="Punctuation"/>
      </rule>
      <rule pattern="[a-zA-Z_]\w*">
        <token type="NameVariable"/>
      </rule>
    </state>
  </rules>
</lexer>
