p("parsePath()");
/*
* Locals
*/
TikzPath path = null;
ArrayList<TikzFigure> figures = new ArrayList<TikzFigure>();
ArrayList<Object> tokens = new ArrayList<Object>();
/*
* Check path trigger \
*/
if(skipChar() != TikzPath.PATH_TRIGGER) {
throw new TikzParserException(TikzPath.PATH_TRIGGER +" expected");
}
/*
* Read path type (i.e. draw)
*/
TikzPathType pt = readPathType();
tokens.add(pt);
p("PathType gelesen");
tokens.add(readWhitespaces());
p("whitespaces nach PathType gelesen");
/*
* Read parameters (i.e. [color=blue,fill=white])
*/
TikzParameters pathParams = null;
try {
pathParams = parseParameters();
tokens.add(pathParams);
} catch(TikzParserException tpe) {}
p("TikzParameters gelesen");
tokens.add(readWhitespaces());
/*
* Read first coordinate
*/
origin = parseCoordinate();
tokens.add(origin);
/*
* Read path chain (i.e. rectangle (2,4) -- (1,2))
*/
parsePathChain(tokens,figures);
/*
* Construct path and return it
*/
path = new TikzPath(pt, pathParams, figures);
SyntaxTikzPath stp = new SyntaxTikzPath(path,tokens);
return stp;
}