package de.jbible.service.ImportDBG;

import java.lang.System;
import java.io.*;


/**
 * This class makes the lexical analysis of
 * ASCII- Versions from the Deutsche Bibelgesellschaft.
 *
 * The final version of this class is generated by the JLex generator.
 */

class Utility {
  public static void assert
    (
     boolean expr
     )
      {
	if (false == expr) {
	  throw (new Error("Error: Assertion failed."));
	}
      }

  private static final String errorMsg[] = {
    "Error: Unmatched end-of-comment punctuation.",
    "Error: Unmatched start-of-comment punctuation.",
    "Error: Unclosed string.",
    "Error: Illegal character."
    };

  public static final int E_ENDCOMMENT = 0;
  public static final int E_STARTCOMMENT = 1;
  public static final int E_UNCLOSEDSTR = 2;
  public static final int E_UNMATCHED = 3;

  public static void error
    (
     int code
     )
      {
	System.out.println(errorMsg[code]);
      }
}


%%

%full
%line
%public
%eofval{
	yy_reader.close();
	return new Yytoken (ImportDBGParser.EOF,"",yyline);
%eofval}



ALPHA=[A-Za-z\xe4\xc4\xf6\xd6\xfc\xdc\xdf\xef\xeb]
DIGIT=[0-9]
NONNEWLINE_WHITE_SPACE_CHAR=[\ \t\b\012]
WHITE_SPACE_CHAR=[\n\ \t\b\012\x0d\x0a\x1a]
WORDSYMBOLS = ['.,;:!=?\x2d\xbb\xab\x5b\x5d\x2f\x7e\(\)]


%%

<YYINITIAL> "|K" { return (new Yytoken(ImportDBGParser.CHAPTER,yyline)); }
<YYINITIAL> "|B" { return (new Yytoken(ImportDBGParser.BOOK,yyline)); }
<YYINITIAL> "|V" { return (new Yytoken(ImportDBGParser.VERS,yyline)); }
<YYINITIAL> "|U" { return (new Yytoken(ImportDBGParser.START_HEADLINE,yyline)); }
<YYINITIAL> "U|" { return (new Yytoken(ImportDBGParser.END_HEADLINE,yyline)); }
<YYINITIAL> "U |" { return (new Yytoken(ImportDBGParser.END_HEADLINE,yyline)); }
<YYINITIAL> "|A" { return (new Yytoken(ImportDBGParser.START_PARAGRAPH_PARALLEL,yyline)); }
<YYINITIAL> "A|" { return (new Yytoken(ImportDBGParser.END_PARAGRAPH_PARALLEL,yyline)); }
<YYINITIAL> "|P" { return (new Yytoken(ImportDBGParser.START_WORD_PARALLEL,yyline)); }
<YYINITIAL> "P|" { return (new Yytoken(ImportDBGParser.END_WORD_PARALLEL,yyline)); }
<YYINITIAL> "|Z" { return (new Yytoken(ImportDBGParser.START_COMMENT,yyline)); }
<YYINITIAL> "Z|" { return (new Yytoken(ImportDBGParser.END_COMMENT,yyline)); }
<YYINITIAL> "|S" { return (new Yytoken(ImportDBGParser.START_EXPLANATION,yyline)); }
<YYINITIAL> "S|" { return (new Yytoken(ImportDBGParser.END_EXPLANATION,yyline)); }
<YYINITIAL> "*" { return (new Yytoken(ImportDBGParser.COMMENT_MARKER,"*",yyline)); }
<YYINITIAL> "**" { return (new Yytoken(ImportDBGParser.COMMENT_MARKER,"**",yyline)); }
<YYINITIAL> \([a-z]\) { return (new Yytoken(ImportDBGParser.PARALLEL_MARKER,yytext(),yyline)); }
<YYINITIAL> {DIGIT}+ { return (new Yytoken(ImportDBGParser.NUMBER,yytext(),yyline)); }
<YYINITIAL> {ALPHA}({ALPHA}|{DIGIT}|_)* { return (new Yytoken(ImportDBGParser.WORD,yytext(),yyline)); }
<YYINITIAL> {WORDSYMBOLS} { return (new Yytoken(ImportDBGParser.WORD,yytext(),yyline)); }
<YYINITIAL> {WHITE_SPACE_CHAR}+ {}









