com.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

## jpicedt.graphic.io.parser Class LaTeXParser

java.lang.Object
jpicedt.graphic.io.parser.AbstractRegularExpression
jpicedt.graphic.io.parser.SequenceExpression
jpicedt.graphic.io.parser.LaTeXParser

All Implemented Interfaces:
ExpressionConstants

public class LaTeXParser
extends SequenceExpression
implements ExpressionConstants

LaTeX (including epic/eepic and pstricks macros) parser This class consists essentially of LaTeX grammar rules (subexpression included in the "root" sequence expression) and a method "parse()" which kicks off the parsing process. Being a SequenceExpression, this is indeed the root expression, which encompasses every other grammar rules as childrens of this SequenceExpression.

 Nested Class Summary  class LaTeXParser.Pool           an inner class that serves as a parameter stack for the parser, i.e.

 Field Summary private  Context context private  LaTeXParser.Pool pool

 Fields inherited from class jpicedt.graphic.io.parser.SequenceExpression

 Fields inherited from interface jpicedt.graphic.io.parser.ExpressionConstants ANY_CHAR, ANY_CHAR_EOL, ANY_SIGN, AT_LEAST, AT_MOST, DEBUG, DOUBLE, EOL, EXACTLY, INTEGER, NEGATIVE, NON_NULL, POSITIVE, STRICTLY_NEGATIVE, STRICTLY_POSITIVE, WHITE_SPACES, WHITE_SPACES_OR_EOL

 Constructor Summary LaTeXParser()           Creates a new LaTeXParser, and build grammar rules As of jPicEdt 1.3.2 (when I started implementing PsTricks support), I decided to allow for both LaTeX/eepic and PsTricks to be mixed in the same grammar, instead of implementing two distinct subtrees (one for LaTeX/eepic, the other one for PsTricks), each starting with its own environment opening expression (e.g.

 Method Summary static void main(java.lang.String[] arg)           parser standalone test  jpicedt.graphic.model.Drawing parse(java.io.Reader reader)           kicks off the parsing process this method is thread-safe, and can be called from outside AWTEventDispatchThread ; every call to the paint mechanism (e.g.  java.lang.String toString()           Convert this Object to a human-readable String.

 Methods inherited from class jpicedt.graphic.io.parser.SequenceExpression add, interpret

 Methods inherited from class jpicedt.graphic.io.parser.AbstractRegularExpression action

 Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 Field Detail

### pool

private LaTeXParser.Pool pool

### context

private Context context
 Constructor Detail

### LaTeXParser

public LaTeXParser()
Creates a new LaTeXParser, and build grammar rules As of jPicEdt 1.3.2 (when I started implementing PsTricks support), I decided to allow for both LaTeX/eepic and PsTricks to be mixed in the same grammar, instead of implementing two distinct subtrees (one for LaTeX/eepic, the other one for PsTricks), each starting with its own environment opening expression (e.g. "\\begin{picture}"). As a result, the file can start with either of the two allowed opening expression (or even none of them since they're optional), then contain at the same time LaTeX, eepic or PsTricks macros, and finally end with either of the two allowed closing expression. Such things give weird results when compiled with LaTeX, however it sounds less severe for the user who wants to write its own file by hand with a jPicEdt-parsing only in view. (for example by mixing %-like PicEdt commands, pure eepic commands, and PsTricks macros). By the time I'll be finished with the PS and PDF parser, I plan however to put the laters in different subtrees to avoid confusion (but in this case, it seems to me that it is absolutely founded).

 Method Detail

### parse

public jpicedt.graphic.model.Drawing parse(java.io.Reader reader)
throws ParserException
kicks off the parsing process this method is thread-safe, and can be called from outside AWTEventDispatchThread ; every call to the paint mechanism (e.g. repaint or revalidate to signal advances of the parsing process to the GUI) is done through SwingUtilities.

### toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).

Overrides:
toString in class SequenceExpression

### main

public static void main(java.lang.String[] arg)
parser standalone test