## Parsing input files

When parsing input files, jPicEdt can handle a variety of, say, syntax deviations... I carved it fairly robust :-), and you needn't worry too much about whether your syntax is perfectly LaTeX-, epic- or PsTricks- compliant or not, since jPicEdt will issue a pretty informative message as soon as it finds a syntax error, an incorrect format number, etc... However, we strongly encourage you to follow these rules :

- jPicEdt expects to find a `\unitlength` or a `\psset{unit=xxx}` (or xunit, yunit, runit) command at the very beginning of your file, or at least before the first command you want to be processed ; it not, default unitlength will be assumed, e.g. 1cm for PsTricks until one of these commands are found.
- jPicEdt accepts almost every command of the LaTeX picture environment, the epic/eepic packages, and the PsTricks base-package, though for the later add-ons packages are not supported yet, e.g. pst-nodes.sty or pst-coils.sty. `\multiput` (and its PsTricks equivalent) are not handled yet.
- It is perfectly possible to mix LaTeX, eepic and Pstricks commands in the same file. PsTricks default parameters (those set by `\psset` commands) won't interfere with LaTeX or eepic ones (e.g. `linethickness`).
- As of LaTeX boxes (e.g. framebox,...), don't expect true WYSIWYG behaviour ! JPicEdt doesn't embed any TeX compiler, hence only a limited set of LR-commands is handled (specifically : only very commands related to the picture environment, see LaTeX, a documentation preparation system, Leslie Lamport, p.97 and p.108).
- The parsing process ends if, either an End-of-file is encountered, or a `\end{picture}` (or its equivalent for PsTricks) is found.

In case you are still fathoming out what those weird comment lines that jPicEdt adds to your file really mean, here are some hints. We rely on this trick for commands that cannot be put on a single line : using a %Begin and %End blocks is a way of making jpicedt understand that every command that lies inside the block belongs to the same graphical element, e.g. a circle, a line,.... Obviously, for graphical elements whose formatted string holds on a single line (which is always the case for PsTricks, so far), there's no need to rely on this trick however.

Note : this small grammar was designed at a time where only the LaTeX picture environment and the epic/eepic package were handled by jPicEdt. Don't expect to find parameters related to colours, shadows or textures ! (please use PsTricks in this case). Only rules needed to properly represent a compound graphical object with the set of graphical attributes offered by the eepic package are part of this grammar, no less, no more...

Line | %Line 0 0 (x1,y1)(x2,y2) %End Line
Vector (arrow on first end) | %Line 1 0 (x1,y1)(x2,y2) %End Line
Vector (arrow on second end) | %Line 0 1 (x1,y1)(x2,y2) %End Line
Vector (two arrows) | %Line 1 1 (x1,y1)(x2,y2) %End Line
Dashed line (or vector) * | %Line 0 0 (x1,y1)(x2,y2) dash=value_in_mm %End Line
Ellipse (hollowed) | %Ellipse (x_centre,y_centre)(width)(height) %End Ellipse
Black-, gray- or white-filled ellipse * | %Ellipse (x_centre,y_centre)(width)(height) blacken|shade|whiten %End Ellipse
Dashed ellipse * | %Ellipse (x_centre,y_centre)(diameter)(diameter) dash=value_in_mm %End Ellipse
Arc | %Ellipse (x_centre,y_centre)(diameter)(diameter) arcStart=angle_in_degree arcExtent=angle_in_degree %End Ellipse
Rectangle (First point = bottom left corner ; second point = top right corner) | %Rectangle(x1,y1)(x2,y2) %End Rectangle
Black-, gray- or white-filled rectangle * | %Rectangle(x1,y1)(x2,y2) blacken|shade|whiten %End Rectangle
Dashed rectangle | %Rectangle(x1,y1)(x2,y2) dash=value_in_mm %End Rectangle
Bezier splines (quadratic) | %Bezier 0 0 (x1,y1)(x_control,y_control)(x2,y2) %End Bezier
Bezier splines (quadratic) with an arrow on the first point | %Bezier 1 0 (x1,y1)(x_control,y_control)(x2,y2) %End Bezier
Bezier splines (quadratic) with an arrow on the second point | %Bezier 0 1 (x1,y1)(x_control,y_control)(x2,y2) %End Bezier
Bezier splines (quadratic) with two arrows | %Bezier 1 1 (x1,y1)(x_control,y_control)(x2,y2) %End Bezier
Filled Polygons (possibly closed) * | %Polygon (x1,y1)...(xN,yN) blacken|shade|whiten closed %End Polygon
Dashed Polygons (possibly closed) | %Polygon (x1,y1)...(xN,yN) dash=value_in_mm closed %End Polygon
Begin group | %Begin group
End group | %End group
Text | See LaTeX and PsTricks documentation about using \makebox,\framebox, \dashbox, \psframebox,... commands.

Please note :

- commands marked with an * are supported by eepic only.
- Order of optional params (such as dash=..., fill-colour, etc...) is not significant.
- Cubic splines, which are not supported by the LaTeX picture environment, are converted to a pair of quad splines before formatting (see "Numerical Recipes in Fortran" for the algorithm used to convert a cubic to two quads).