|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.czt.parser.z.Latex2Unicode
public class Latex2Unicode
The low-level latex to unicode scanner for Z.
See LatexToUnicode for a high level latex to unicode converter.
This is a JFlex generated scanner for translating
Z
specifications written in the latex mark-up language into unicode.
It provides tokens (instances of class Symbol) whos values
are unicode strings and which contain line and column number
information of the original latex file or stream.
See LatexSym for a list of possible token kinds.
In order to work properly, a map containing the latex mark-up function
of the current section to be scanned is needed. This map must be
updated when a new section header is recognised.
The LatexMarkupParser is
responsible for this task, and should process the output of an instance
of this class before it can be processed further.
Limitations:
| Field Summary | |
|---|---|
static int |
COMMENT_STATE
|
static int |
ERROR
|
static int |
MARKUP
lexical states |
static int |
YYEOF
This character denotes the end of file |
static int |
YYINITIAL
|
static int |
ZED
|
| Fields inherited from interface net.sourceforge.czt.parser.util.ParsePropertiesKeys |
|---|
PROP_IGNORE_UNKNOWN_LATEX_COMMANDS |
| Constructor Summary | |
|---|---|
Latex2Unicode(java.io.InputStream in)
Creates a new scanner. |
|
Latex2Unicode(java.io.Reader in)
Creates a new scanner There is also a java.io.InputStream version of this constructor. |
|
Latex2Unicode(net.sourceforge.czt.session.Source source,
net.sourceforge.czt.session.SectionInfo sectInfo,
java.util.Properties properties)
Creates a new scanner for the source. |
|
| Method Summary | |
|---|---|
LatexMarkupFunction |
getMarkupFunction()
Returns the latex mark-up function. |
net.sourceforge.czt.session.Source |
getSource()
The source that is lexed. |
LocToken |
next()
Resumes scanning until the next regular expression is matched, the end of input is encountered or an I/O-Error occurs. |
void |
setMarkupFunction(LatexMarkupFunction markupFunction)
Sets the latex mark-up function. |
void |
yybegin(int newState)
Enters a new lexical state |
char |
yycharat(int pos)
Returns the character at position pos from the matched text. |
void |
yyclose()
Closes the input stream. |
int |
yylength()
Returns the length of the matched text region. |
void |
yypushback(int number)
Pushes the specified amount of characters back into the input stream. |
void |
yyreset(java.io.Reader reader)
Resets the scanner to read from a new input stream. |
int |
yystate()
Returns the current lexical state. |
java.lang.String |
yytext()
Returns the text matched by the current regular expression. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int YYEOF
public static final int MARKUP
public static final int ERROR
public static final int COMMENT_STATE
public static final int YYINITIAL
public static final int ZED
| Constructor Detail |
|---|
public Latex2Unicode(net.sourceforge.czt.session.Source source,
net.sourceforge.czt.session.SectionInfo sectInfo,
java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionpublic Latex2Unicode(java.io.Reader in)
in - the java.io.Reader to read input from.public Latex2Unicode(java.io.InputStream in)
in - the java.io.Inputstream to read input from.| Method Detail |
|---|
public net.sourceforge.czt.session.Source getSource()
Lexer
getSource in interface Lexerpublic LatexMarkupFunction getMarkupFunction()
setMarkupFunction(net.sourceforge.czt.parser.util.LatexMarkupFunction)public void setMarkupFunction(LatexMarkupFunction markupFunction)
LatexCommand containing the unicode representation.
This map must be kept up to date to ensure proper working of
instances of this class.
setMarkupFunction in interface LatexMarkupParser.LatexLexer
public final void yyclose()
throws java.io.IOException
java.io.IOExceptionpublic final void yyreset(java.io.Reader reader)
reader - the new input streampublic final int yystate()
public final void yybegin(int newState)
newState - the new lexical statepublic final java.lang.String yytext()
public final char yycharat(int pos)
pos - the position of the character to fetch.
A value from 0 to yylength()-1.
public final int yylength()
public void yypushback(int number)
number - the number of characters to be read again.
This number must not be greater than yylength()!
public LocToken next()
throws java.io.IOException
next in interface Lexerjava.io.IOException - if any I/O-Error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||