|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.parsers.CodeParser
public abstract class CodeParser
Defines an abstract parser that parses code.
This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for more details.
11/21/08
Nested Class Summary | |
---|---|
private static class |
CodeParser.Code
Defines a core level of the code parser that can be share with others code parser. |
Field Summary | |
---|---|
protected CodeParser.Code |
codeCore
The core level of the parser that contains the code to parse,... |
static int |
EOC
The token for the end of the code. |
Constructor Summary | |
---|---|
CodeParser(java.lang.String code)
Creates and initialises the code parser. |
Method Summary | |
---|---|
int |
getChar()
|
int |
getCharAt(int pos)
The character at the given position. |
java.lang.String |
getCode()
|
CodeParser.Code |
getCodeCore()
|
int |
getLinePosition()
|
int |
getPosition()
|
void |
incLinePosition()
Increments the line position. |
void |
initialise()
Reinitialises the parser. |
abstract boolean |
isComment()
|
boolean |
isEOC()
|
boolean |
isEOL()
|
abstract boolean |
isWSP()
|
int |
nextChar()
Reads the next char and returns it. |
void |
setCode(java.lang.String code)
|
void |
setCodeCore(CodeParser.Code codeCore)
|
void |
setLinePosition(int linePosition)
|
void |
setPosition(int position)
|
abstract java.lang.String |
skipComment()
Skips the comment. |
abstract void |
skipWSP()
Skips the useless characters. |
void |
skipWSPComments()
Skips both comments and ignorable characters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.latexdraw.parsers.Parser |
---|
parse |
Field Detail |
---|
public static final int EOC
protected CodeParser.Code codeCore
Constructor Detail |
---|
public CodeParser(java.lang.String code)
code
- The code to parse.
java.lang.IllegalArgumentException
- If the given code is null.Method Detail |
---|
public void initialise()
public java.lang.String getCode()
public void setCode(java.lang.String code)
code
- the code to set. It re-initialises the parser.public int nextChar()
public int getCharAt(int pos)
pos
- The position of the wanted character.
public int getChar()
public boolean isEOC()
public int getPosition()
public int getLinePosition()
public abstract java.lang.String skipComment()
public abstract void skipWSP()
public void skipWSPComments()
public abstract boolean isComment()
public abstract boolean isWSP()
public boolean isEOL()
public void setPosition(int position)
position
- the position to set.public void incLinePosition()
public void setLinePosition(int linePosition)
linePosition
- the line position to set. Must be greater than 0.public CodeParser.Code getCodeCore()
public void setCodeCore(CodeParser.Code codeCore)
codeCore
- the code core to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |