// $ANTLR 2.7.5 (20050128): "mathematica.g" -> "MathematicaParser.java"$

/**
* this code is generated by ANTLR from the 'mathematica.g'-file
* @author Bernd Gonska
* @version 1.0
*/
package de.jreality.reader.mathematica;
import java.awt.*;
import java.util.*;
import java.util.List;
import de.jreality.geometry.*;
import de.jreality.math.*;
import de.jreality.scene.data.*;
import de.jreality.scene.*;
import de.jreality.scene.SceneGraphComponent;
import de.jreality.shader.*;
import de.jreality.util.LoggingSystem;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.io.File;

import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;

public class MathematicaParser extends antlr.LLkParser       implements MathematicaParserTokenTypes
 {

/**
* wandelt Graphic3D- Objekte die aus Mathematica mittels 
* 			<Graphics3D -Object> >> <Pfad>\ <fileName.m>
* herausgeschrieben wurden in einen SceneGraphen von JReality um.
*
* Die Daten haben im file folgende Form(sind uebrigens direkter Mathematica-Text):
* Graphics3D[ {} , {} ]
* in der ersten Klammer steht ein "{..}"-Klammer Baum von gemischten Listen aus 
* graphischen Objekten und graphischen Directiven( wie Farben ect.)
* Bsp: Graphics3D[ 		{o1,o2,d1,{d2,o3,{o4},d3,o5}} 			,{} ]   
*					(d1-d3 Directiven , o1-o5 graphische Objekte)
* in der 2. Klammer steht eine Liste von Optionen die die ganze Scene beinflussen.
* Bsp: Graphics3D[ 		{o1,o2,d1,{d2,o3,{o4},d3,o5}} 			,{Op1,Opt2,..} ]
* 			Von dieser Beschreibung sind manche Dinge Optional !
*
* Vorgehen: 
* erste Klammer:
*		Klammern werden zu SceneGraphComponents die den Inhalt als Unterbaeume tragen.
* 		die graphischen Objekte werden je zu einer SceneGr.C. mit entsprechender Geometrie
*			manche Objekte werden hierbei zusammengefast*
*		die graphischen Directiven werden in der jeweils betroffenen Geometrie gesetzt(Farben)
*			oder als Appearance in den zur Geom. gehoerenden Knoten gesetzt.(Punktgroesse ect.)
*					manche Directiven werden ueberlesen!!!
* zweite Klammer:
*		die meissten Optionen werden ueberlesen!!!
*		Ansonsten werden sie den Root Knoten beeinflussen.
*
* Polygone die in einer Liste bis auf Flaechen-Farb-Direktiven untereinander stehen,
*	 	werden zu einer indexedFaceSet
*   Linien die in einer Liste bis auf einfache-Farb-Direktiven untereinander stehen,
*	 	werden zu einer indexedLineSet
*   Punkte die in einer Liste bis auf einfache-Farb-Direktiven untereinander stehen,
*	 	werden zu einem PointSet
* 	 TexteMarken werden zu gelabelten EINELEMENTIGEN Pointsets.(sie werden nicht verbunden)
*
*   desweiteren werden auf Wunsch doppelte Punkte aus Line- und Face- Sets aussortiert
* 		das ermoeglicht u.a. smoothshading bei Flaechen aus getrennt angegebenen Polygonen(das ist ueblich)
*
*   Farben werden je nach Bedarf als Farbliste in Line-, Point-, und Face- Sets eingebunden.
*   	Vorzugsweise aber als Farbe in der Appearance des Unterknotens.
*
* Internes:
* ueberall die aktuelle Appearance, FlaechenFarbe(fC), und Punkt/LinienFarbe(plC) durchreichen
*
* TODO:
* alle Optionen sind noch unbehandelt (siehe dort: "optionPrimitives")
* Standard Lichter und Camera werden nicht uebernommen 
* 		(der Scenegraph hat keine Lichter oder Camera)
* ein paar Directiven werden auch ignoriert (siehe dort: "directive")
* Auch wenn Appearances wie Directiven fuer ganze gruppen gelten koennen,
*		werden sie erst im Knoten der Geometrie eingesetzt.


* Problem: manchmal werden Coordinaten so ausgerechnet das sie noch einen 
*	 Imaginaerteil haben ( meist = 0) der noch dahinter steht
*	Loesung :ein + ...*I ignorieren!
*			   Doubles werden ja immer durch "," getrennt! Also geht das!
*			   sollte jemand komplexe Zahlen lesen wollen
*				oder doubles ohne Komma parsen wollen 
*				so erstellt man dann noch eine extra RegelMethode
*/

	// this is what is returned from the parsing process
	private SceneGraphComponent root = new SceneGraphComponent();	
	
	private SceneGraphComponent current = root;		// aktuell zu erweiternder Knoten 
	private Logger log = LoggingSystem.getLogger(MathematicaParser.class);
//	private CoordinateSystemFactory box;
	private Appearance startApp =new Appearance();
	private Color plCDefault= new Color(127,127,127);	// default- Punkt und Linienfarbe
	private Color fCDefault = new Color(255,255,255);	// default- Flaechenfarbe
	
	private boolean optGeo=false;
	public void setOptimizeGeometry(boolean flag){optGeo=flag;}
	
//	private Object defaultEdgeForm = Color.black;
	private Object defaultEdgeForm = new Double(1); 

// ---------------------------- total Sizes of Scene --------------------------
	private double[][] borderValue= new double [3][]; // maximale Werte der Scenenkoordinaten in x-,y- und z-Richtung
	private boolean gotFirstPoint =false;
	private void resetBorder (double [] v){	  // erweitert den borderValue moeglicherweise durch diesen Punkt
		if (gotFirstPoint){ // set Borders for viewed size
			for (int i=0;i<3;i++){
				if (v[i] < borderValue[0][i])
					borderValue[0][i] = v[i];
				if (borderValue[1][i] < v[i])
					borderValue[1][i] = v[i];
			}
		}
		else{
			borderValue[0]=v;
			borderValue[1]=v;
			gotFirstPoint=true;		
		}
	}

// -------------------------------- default Lights ----------------------------
	public static SceneGraphComponent getDefaultLightNode (){
		return	MathematicaHelper.getDefaultLightNode();
	} 


/**
* konstructs a parser who can translate a
* mathematica-file to the corresponding SceneGraph
* @param    see superclass
* example: MathematicaParser p=
*	    new MathematicaParser(new MathematicaLexer(
*	     new FileReader(new File("file.m"))));
*/

protected MathematicaParser(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
}

public MathematicaParser(TokenBuffer tokenBuf) {
  this(tokenBuf,2);
}

protected MathematicaParser(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
}

public MathematicaParser(TokenStream lexer) {
  this(lexer,2);
}

public MathematicaParser(ParserSharedInputState state) {
  super(state,2);
  tokenNames = _tokenNames;
}

/**
* starts the parsing Process
* @param none sourcefile set by creating the object
* @returns SceneGraphComponent root of generated scene
*/
	public final SceneGraphComponent  start() throws RecognitionException, TokenStreamException {
		SceneGraphComponent r=new SceneGraphComponent();
		
		
			root.setName("Mathematica");
			log.setLevel(Level.FINE);	
		
		
		try {      // for error handling
			{
			switch ( LA(1)) {
			case 7:
			{
				graphics3D();
				break;
			}
			case OPEN_BRACE:
			{
				match(OPEN_BRACE);
				listOfGraphics();
				match(CLOSE_BRACE);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			
					r = root;
					if(r==null)r= new SceneGraphComponent();
					
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_0);
		}
		return r;
	}
	
	private final void graphics3D() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(7);
			match(OPEN_BRACKET);
			{
			switch ( LA(1)) {
			case OPEN_BRACE:
			{
				{
				match(OPEN_BRACE);
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				case LITERAL_Cuboid:
				case LITERAL_Sphere:
				case LITERAL_Cylinder:
				case LITERAL_Text:
				case LITERAL_Point:
				case LITERAL_Line:
				case LITERAL_Polygon:
				case LITERAL_EdgeForm:
				case LITERAL_SurfaceColor:
				case LITERAL_RGBColor:
				case LITERAL_Hue:
				case LITERAL_GrayLevel:
				case LITERAL_CMYKColor:
				case LITERAL_AbsolutePointSize:
				case LITERAL_AbsoluteThickness:
				case LITERAL_Dashing:
				case LITERAL_FaceForm:
				case LITERAL_PointSize:
				case LITERAL_Thickness:
				case LITERAL_AbsoluteDashing:
				{
					objectList(startApp,defaultEdgeForm);
					break;
				}
				case CLOSE_BRACE:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACE);
				}
				break;
			}
			case LITERAL_Cuboid:
			case LITERAL_Sphere:
			case LITERAL_Cylinder:
			case LITERAL_Polygon:
			case LITERAL_SurfaceColor:
			{
				faceThing(startApp,defaultEdgeForm);
				break;
			}
			case LITERAL_Text:
			case LITERAL_Point:
			case LITERAL_Line:
			case LITERAL_RGBColor:
			case LITERAL_Hue:
			case LITERAL_GrayLevel:
			case LITERAL_CMYKColor:
			{
				plThing(startApp);
				break;
			}
			case LITERAL_AbsolutePointSize:
			case LITERAL_AbsoluteThickness:
			case LITERAL_Dashing:
			case LITERAL_FaceForm:
			case LITERAL_PointSize:
			case LITERAL_Thickness:
			case LITERAL_AbsoluteDashing:
			{
				appThing(startApp);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			{
			switch ( LA(1)) {
			case COLON:
			{
				match(COLON);
				egal();
				log.fine("options are not supported");
				break;
			}
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(CLOSE_BRACKET);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_1);
		}
	}
	
	private final void listOfGraphics() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			{
			switch ( LA(1)) {
			case OPEN_BRACE:
			case 7:
			{
				{
				switch ( LA(1)) {
				case 7:
				{
					graphics3D();
					break;
				}
				case OPEN_BRACE:
				{
					match(OPEN_BRACE);
											
								// neuen Knoten erstellen der die Listenelemente enthaelt, 
								SceneGraphComponent newPart = new SceneGraphComponent();
								newPart.setName("Graphic");
								SceneGraphComponent oldPart = current;
								current.addChild(newPart);
								current=newPart;
								
					listOfGraphics();
					match(CLOSE_BRACE);
					current=oldPart;
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				{
				_loop7:
				do {
					if ((LA(1)==COLON) && ((LA(2) >= OPEN_BRACE && LA(2) <= 7))) {
						match(COLON);
						listOfGraphics();
					}
					else {
						break _loop7;
					}
					
				} while (true);
				}
				break;
			}
			case CLOSE_BRACE:
			case COLON:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
	}
	
	private final void objectList(
		Appearance app, Object edgeF
	) throws RecognitionException, TokenStreamException {
		
		Appearance app2=MathematicaHelper.copyApp(app);
		
		try {      // for error handling
			{
			switch ( LA(1)) {
			case OPEN_BRACE:
			{
				list(app2 ,edgeF);
				break;
			}
			case LITERAL_EdgeForm:
			{
				edgeF=edgeFormThing();
				break;
			}
			case LITERAL_Cuboid:
			case LITERAL_Sphere:
			case LITERAL_Cylinder:
			case LITERAL_Polygon:
			case LITERAL_SurfaceColor:
			{
				app2=faceThing(app2,edgeF);
				break;
			}
			case LITERAL_Text:
			case LITERAL_Point:
			case LITERAL_Line:
			case LITERAL_RGBColor:
			case LITERAL_Hue:
			case LITERAL_GrayLevel:
			case LITERAL_CMYKColor:
			{
				app2=plThing(app2);
				break;
			}
			case LITERAL_AbsolutePointSize:
			case LITERAL_AbsoluteThickness:
			case LITERAL_Dashing:
			case LITERAL_FaceForm:
			case LITERAL_PointSize:
			case LITERAL_Thickness:
			case LITERAL_AbsoluteDashing:
			{
				app2=appThing(app2);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			{
			_loop19:
			do {
				if ((LA(1)==COLON)) {
					match(COLON);
					{
					switch ( LA(1)) {
					case OPEN_BRACE:
					{
						list(app2,edgeF);
						break;
					}
					case LITERAL_EdgeForm:
					{
						edgeF=edgeFormThing();
						break;
					}
					case LITERAL_Cuboid:
					case LITERAL_Sphere:
					case LITERAL_Cylinder:
					case LITERAL_Polygon:
					case LITERAL_SurfaceColor:
					{
						app2=faceThing(app2,edgeF);
						break;
					}
					case LITERAL_Text:
					case LITERAL_Point:
					case LITERAL_Line:
					case LITERAL_RGBColor:
					case LITERAL_Hue:
					case LITERAL_GrayLevel:
					case LITERAL_CMYKColor:
					{
						app2=plThing(app2);
						break;
					}
					case LITERAL_AbsolutePointSize:
					case LITERAL_AbsoluteThickness:
					case LITERAL_Dashing:
					case LITERAL_FaceForm:
					case LITERAL_PointSize:
					case LITERAL_Thickness:
					case LITERAL_AbsoluteDashing:
					{
						app2=appThing(app2);
						break;
					}
					default:
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					}
					}
				}
				else {
					break _loop19;
				}
				
			} while (true);
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_3);
		}
	}
	
	private final Appearance  faceThing(
		Appearance app, Object edgeF
	) throws RecognitionException, TokenStreamException {
		Appearance app2;
		
		app2=MathematicaHelper.copyApp(app);
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_Cuboid:
			{
				cuboid(app2,edgeF);
				break;
			}
			case LITERAL_Sphere:
			{
				sphere(app2,edgeF);
				break;
			}
			case LITERAL_Cylinder:
			{
				cylinder(app2,edgeF);
				break;
			}
			case LITERAL_Polygon:
			{
				app2=polygonBlock(app2,edgeF);
				break;
			}
			case LITERAL_SurfaceColor:
			{
				app2=faceColor(app2);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app2;
	}
	
	private final Appearance  plThing(
		Appearance app
	) throws RecognitionException, TokenStreamException {
		Appearance app2;
		
		
		app2=MathematicaHelper.copyApp(app);
		Color c= null;
		
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_RGBColor:
			case LITERAL_Hue:
			case LITERAL_GrayLevel:
			case LITERAL_CMYKColor:
			{
				c=color();
				app2=MathematicaHelper.setPLColor(app2,c);
				break;
			}
			case LITERAL_Line:
			{
				app2=lineBlock(app2);
				break;
			}
			case LITERAL_Point:
			{
				app2=pointBlock(app2);
				break;
			}
			case LITERAL_Text:
			{
				text(app2);
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app2;
	}
	
	private final  Appearance  appThing(
		Appearance appOld
	) throws RecognitionException, TokenStreamException {
		 Appearance app;
		
		app=MathematicaHelper.copyApp(appOld);
		
		try {      // for error handling
			app=directiveBlock(app);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app;
	}
	
	private final void egal() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			{
			_loop111:
			do {
				if ((_tokenSet_5.member(LA(1))) && ((LA(2) >= OPEN_BRACE && LA(2) <= WS_))) {
					{
					match(_tokenSet_5);
					}
				}
				else {
					break _loop111;
				}
				
			} while (true);
			}
			{
			switch ( LA(1)) {
			case OPEN_BRACE:
			{
				match(OPEN_BRACE);
				{
				_loop114:
				do {
					if ((_tokenSet_6.member(LA(1)))) {
						dumb();
					}
					else {
						break _loop114;
					}
					
				} while (true);
				}
				match(CLOSE_BRACE);
				{
				if (((LA(1) >= OPEN_BRACE && LA(1) <= WS_)) && (_tokenSet_7.member(LA(2)))) {
					egal();
				}
				else if ((LA(1)==CLOSE_BRACE||LA(1)==COLON||LA(1)==CLOSE_BRACKET) && (_tokenSet_8.member(LA(2)))) {
				}
				else {
					throw new NoViableAltException(LT(1), getFilename());
				}
				
				}
				break;
			}
			case OPEN_BRACKET:
			{
				match(OPEN_BRACKET);
				{
				_loop117:
				do {
					if ((_tokenSet_6.member(LA(1)))) {
						dumb();
					}
					else {
						break _loop117;
					}
					
				} while (true);
				}
				match(CLOSE_BRACKET);
				{
				if (((LA(1) >= OPEN_BRACE && LA(1) <= WS_)) && (_tokenSet_7.member(LA(2)))) {
					egal();
				}
				else if ((LA(1)==CLOSE_BRACE||LA(1)==COLON||LA(1)==CLOSE_BRACKET) && (_tokenSet_8.member(LA(2)))) {
				}
				else {
					throw new NoViableAltException(LT(1), getFilename());
				}
				
				}
				break;
			}
			case LPAREN:
			{
				match(LPAREN);
				{
				_loop120:
				do {
					if ((_tokenSet_6.member(LA(1)))) {
						dumb();
					}
					else {
						break _loop120;
					}
					
				} while (true);
				}
				match(RPAREN);
				{
				if (((LA(1) >= OPEN_BRACE && LA(1) <= WS_)) && (_tokenSet_7.member(LA(2)))) {
					egal();
				}
				else if ((LA(1)==CLOSE_BRACE||LA(1)==COLON||LA(1)==CLOSE_BRACKET) && (_tokenSet_8.member(LA(2)))) {
				}
				else {
					throw new NoViableAltException(LT(1), getFilename());
				}
				
				}
				break;
			}
			case CLOSE_BRACE:
			case COLON:
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
	}
	
	private final void list(
		Appearance app, Object edgeF
	) throws RecognitionException, TokenStreamException {
		
		Appearance app2=MathematicaHelper.copyApp(app);
		
		try {      // for error handling
			match(OPEN_BRACE);
									
						// neuen Knoten erstellen der die Listenelemente haelt, 
						SceneGraphComponent newPart = new SceneGraphComponent();
						newPart.setName("Object");
			//			newPart.setAppearance(app2);
						SceneGraphComponent oldPart = current;
						current.addChild(newPart);
						current=newPart;
						
			{
			switch ( LA(1)) {
			case OPEN_BRACE:
			case LITERAL_Cuboid:
			case LITERAL_Sphere:
			case LITERAL_Cylinder:
			case LITERAL_Text:
			case LITERAL_Point:
			case LITERAL_Line:
			case LITERAL_Polygon:
			case LITERAL_EdgeForm:
			case LITERAL_SurfaceColor:
			case LITERAL_RGBColor:
			case LITERAL_Hue:
			case LITERAL_GrayLevel:
			case LITERAL_CMYKColor:
			case LITERAL_AbsolutePointSize:
			case LITERAL_AbsoluteThickness:
			case LITERAL_Dashing:
			case LITERAL_FaceForm:
			case LITERAL_PointSize:
			case LITERAL_Thickness:
			case LITERAL_AbsoluteDashing:
			{
				objectList(app2, edgeF);
				break;
			}
			case CLOSE_BRACE:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(CLOSE_BRACE);
			current=oldPart;
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
	}
	
	private final Object  edgeFormThing() throws RecognitionException, TokenStreamException {
		Object c;
		
		c=null;
		
		try {      // for error handling
			match(LITERAL_EdgeForm);
			match(OPEN_BRACKET);
			{
			switch ( LA(1)) {
			case LITERAL_RGBColor:
			case LITERAL_Hue:
			case LITERAL_GrayLevel:
			case LITERAL_CMYKColor:
			{
				c=color();
				break;
			}
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(CLOSE_BRACKET);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
		return c;
	}
	
	private final void cuboid(
		Appearance app,Object edgeF
	) throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(LITERAL_Cuboid);
			match(OPEN_BRACKET);
			double[] v2=new double [3]; 
						v2[0]=v2[1]=v2[2]=1;
						double[] v=new double[3];
						
			v=vektor();
			{
			switch ( LA(1)) {
			case COLON:
			{
				match(COLON);
				v2=vektordata();
				break;
			}
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(CLOSE_BRACKET);
			
						// realisiert durch gestreckten kantenlosen Einheitswuerfel
						 SceneGraphComponent geo=new SceneGraphComponent();
						 current.addChild(geo);
						 geo.setGeometry(Primitives.cube());
				 		 geo.setName("Cuboid");
				 		 Appearance cubicApp =MathematicaHelper.copyApp(app);
				 		 if (edgeF!=null){
				 		 	//cubicApp.setAttribute(CommonAttributes.EDGE_DRAW, true);
						 	//cubicApp.setAttribute(CommonAttributes.TUBES_DRAW, true);
							cubicApp.setAttribute(CommonAttributes.TUBE_RADIUS,1/150);
							cubicApp.setAttribute(CommonAttributes.LINE_WIDTH,1);	 	
							if (edgeF instanceof Color){
						 	  cubicApp.setAttribute(CommonAttributes.LINE_SHADER+"."+
							 	CommonAttributes.POLYGON_SHADER+"."+
							 	CommonAttributes.DIFFUSE_COLOR, (Color)edgeF);
						 	  cubicApp.setAttribute(CommonAttributes.LINE_SHADER+"."+
							 	CommonAttributes.DIFFUSE_COLOR, (Color)edgeF);				 	
							 }
						 }
				 		 else{
					 		 cubicApp.setAttribute(CommonAttributes.EDGE_DRAW, false);
							 //cubicApp.setAttribute(CommonAttributes.TUBES_DRAW, false);
						 }
						 geo.setAppearance(cubicApp);
						 MatrixBuilder.euclidean().scale(v2[0],v2[1],v2[2])
						    .translate(v[0],v[1],v[2]).assignTo(geo);
						
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
	}
	
	private final void sphere(
		Appearance app,Object edgeF
	) throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(LITERAL_Sphere);
			match(OPEN_BRACKET);
			
						double[] center=new double [3]; 
						double radius=1;
						
			center=vektor();
			{
			switch ( LA(1)) {
			case COLON:
			{
				match(COLON);
				radius=doublething();
				break;
			}
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(CLOSE_BRACKET);
			
						 SceneGraphComponent geo=Primitives.sphere(radius, center);
						 current.addChild(geo);
				 		 geo.setName("Cylinder");
				 		 Appearance App =MathematicaHelper.copyApp(app);
				 		 App.setAttribute(CommonAttributes.EDGE_DRAW, false);
						 geo.setAppearance(App);
						
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
	}
	
	private final void cylinder(
		Appearance app,Object edgeF
	) throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			match(LITERAL_Cylinder);
			match(OPEN_BRACKET);
			
						double[] anfg=new double [3]; 
						double[] ende=new double [3]; 
						double radius=1;
						
			match(OPEN_BRACE);
			anfg=vektor();
			match(COLON);
			ende=vektor();
			match(CLOSE_BRACE);
			{
			switch ( LA(1)) {
			case COLON:
			{
				match(COLON);
				radius=doublething();
				break;
			}
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(CLOSE_BRACKET);
			
						// realisiert durch gestreckten Zylinder
						 SceneGraphComponent geo=new SceneGraphComponent();
						 current.addChild(geo);
						 geo.setGeometry(MathematicaHelper.makeCylinder(anfg,ende,radius));
				 		 geo.setName("Cylinder");
				 		 Appearance cylApp =MathematicaHelper.copyApp(app);
				 		 cylApp.setAttribute(CommonAttributes.EDGE_DRAW, false);
				 		 cylApp.setAttribute(CommonAttributes.VERTEX_DRAW, false);
						 geo.setAppearance(cylApp);
						
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
	}
	
	private final Appearance  polygonBlock(
		Appearance app, Object edgeF
	) throws RecognitionException, TokenStreamException {
		Appearance app2;
		
		
		app2=MathematicaHelper.copyApp(app);
		Color fC=MathematicaHelper.getFColor(app2,fCDefault);
		List<double[]> coordinates= new LinkedList<double[]>();// alle PunktListen vereint in einer
		List<double[]> poly=new LinkedList<double[]>();			// alle Punkte in einem Polygon
		int[] polyIndices;					// alle indices eines Polygons
		List<Color> colors= new LinkedList<Color>();		// FarbListe
		List<int[]> polysIndices= new LinkedList<int[]>();// IndexListen-Liste
		int count=0;						// zaehlt die Punkte mit
		boolean colorFlag=false;
		boolean colorNeeded =false;
		
		
		try {      // for error handling
			match(LITERAL_Polygon);
			match(OPEN_BRACKET);
			poly=lineset();
			
								polyIndices=new int[poly.size()];
								int i=0;
								for(double[] d : poly){
									coordinates.add(d);  //Punkte zu einer Liste machen
									polyIndices[i]=i;	 // indizirung merken
									i++;
								}
						    	count=poly.size();
								polysIndices.add(polyIndices);
								colors.add(fC);
							
			match(CLOSE_BRACKET);
			{
			_loop47:
			do {
				if ((LA(1)==COLON) && (LA(2)==LITERAL_Polygon||LA(2)==LITERAL_SurfaceColor)) {
					match(COLON);
					{
					switch ( LA(1)) {
					case LITERAL_SurfaceColor:
					{
						{
						app2=faceColor(app2);
						colorFlag=true; fC=MathematicaHelper.getFColor(app2,fCDefault);
						}
						break;
					}
					case LITERAL_Polygon:
					{
						{
						match(LITERAL_Polygon);
						match(OPEN_BRACKET);
						poly=lineset();
						if (colorFlag) colorNeeded= true;
						
											polyIndices=new int[poly.size()];
											i=0;
											for(double[] d : poly){
												coordinates.add(d);  //Punkte zu einer Liste machen
												polyIndices[i]=i+count;	 // indizirung merken
												i++;
											}
									    	count+=poly.size();
											polysIndices.add(polyIndices);
											colors.add(fC);
										
						match(CLOSE_BRACKET);
						}
						break;
					}
					default:
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					}
					}
				}
				else {
					break _loop47;
				}
				
			} while (true);
			}
			
					double [][] data= new double[count][];
					double [][] colorData = new double[polysIndices.size()][];	
					i=0;
					for(double[] d : coordinates){
						data[i]=((double[]) coordinates.get(i));
						i++;
					}
					int[][] indices= new int[polysIndices.size()][];
					i=0;
					for(int[] d : polysIndices){// Indices als doppelListe von Doubles machen
						indices[i]=d;
						i++;
					}
					i=0;
					for(Color d : colors){
						colorData[i]=MathematicaHelper.getRGBColor(d);
						i++;
					}
					IndexedFaceSetFactory faceSet = new IndexedFaceSetFactory();
					faceSet.setVertexCount(count);
					faceSet.setFaceCount(polysIndices.size());
					faceSet.setFaceIndices(indices);
					faceSet.setVertexCoordinates(data);
					Appearance faceApp =MathematicaHelper.copyApp(app2);
					if (colorNeeded)
						faceSet.setFaceColors(colorData);
				//TODO do not colorice if color == inherit
					else	faceApp.setAttribute(CommonAttributes.POLYGON_SHADER+"."+
						 	CommonAttributes.DIFFUSE_COLOR, fC);
					if (edgeF!=null){
						faceApp.setAttribute(CommonAttributes.TUBE_RADIUS,1/150);
						faceApp.setAttribute(CommonAttributes.LINE_WIDTH,1);	 	
						if (edgeF instanceof Color){
					 		faceApp.setAttribute(CommonAttributes.LINE_SHADER+"."+
						 		CommonAttributes.POLYGON_SHADER+"."+
						 		CommonAttributes.DIFFUSE_COLOR, edgeF);
					 		faceApp.setAttribute(CommonAttributes.LINE_SHADER+"."+
							 	CommonAttributes.DIFFUSE_COLOR, edgeF);				 	
						}
						faceSet.setGenerateEdgesFromFaces(true);
					}
					else faceSet.setGenerateEdgesFromFaces(false);
					faceSet.setGenerateFaceNormals(true);
					faceSet.update();
					IndexedFaceSet ifs= faceSet.getIndexedFaceSet();
					ifs=(IndexedFaceSet)RemoveDuplicateInfo.removeDuplicateVertices(ifs,Attribute.COLORS);
					IndexedFaceSetUtility.assignSmoothVertexNormals(ifs,-1);
					SceneGraphComponent geo=new SceneGraphComponent();	// Komponenten erstellen und einhaengen
					geo.setAppearance(faceApp);
					current.addChild(geo);
					geo.setName("Faces");
					geo.setGeometry(ifs);
				
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app2;
	}
	
	private final Appearance  faceColor(
		Appearance app
	) throws RecognitionException, TokenStreamException {
		Appearance app2;
		
		
		app2=MathematicaHelper.copyApp(app);
		Color specular; double d; Color fC= new Color(255,0,0);
		
		
		try {      // for error handling
			match(LITERAL_SurfaceColor);
			match(OPEN_BRACKET);
			fC=color();
			app2.setAttribute(CommonAttributes.POLYGON_SHADER+"."+
							 	CommonAttributes.DIFFUSE_COLOR, fC);
			{
			switch ( LA(1)) {
			case COLON:
			{
				match(COLON);
				specular=color();
				app2.setAttribute(CommonAttributes.POLYGON_SHADER+"."+CommonAttributes.SPECULAR_COLOR,specular);
				{
				switch ( LA(1)) {
				case COLON:
				{
					match(COLON);
					d=doublething();
					app2.setAttribute(CommonAttributes.POLYGON_SHADER+"."+CommonAttributes.SPECULAR_EXPONENT,d);
					break;
				}
				case CLOSE_BRACKET:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				break;
			}
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			match(CLOSE_BRACKET);
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app2;
	}
	
	private final Color  color() throws RecognitionException, TokenStreamException {
		Color c;
		
		c= new Color(0,255,0);
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_RGBColor:
			{
				match(LITERAL_RGBColor);
				match(OPEN_BRACKET);
				double r,g,b; r=b=g=0;
				r=doublething();
				match(COLON);
				g=doublething();
				match(COLON);
				b=doublething();
				match(CLOSE_BRACKET);
				
									 float red,green,blue;
									 red=(float) r; green=(float) g; blue=(float) b;
									 c= new Color(red,green,blue);
									
				break;
			}
			case LITERAL_Hue:
			{
				match(LITERAL_Hue);
				match(OPEN_BRACKET);
				double h; double s; double b; h=s=b=0.5;
				h=doublething();
				{
				switch ( LA(1)) {
				case COLON:
				{
					match(COLON);
					s=doublething();
					match(COLON);
					b=doublething();
					break;
				}
				case CLOSE_BRACKET:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACKET);
				
									 float hue,sat,bri;
									 hue=(float) h; sat=(float) s; bri=(float) b;
									 c = Color.getHSBColor(hue,sat,bri);
									
				break;
			}
			case LITERAL_GrayLevel:
			{
				match(LITERAL_GrayLevel);
				match(OPEN_BRACKET);
				double gr=0;
				gr=doublething();
				match(CLOSE_BRACKET);
				
									float grey=(float) gr;
									c= new Color(grey,grey,grey);
									
				break;
			}
			case LITERAL_CMYKColor:
			{
				match(LITERAL_CMYKColor);
				match(OPEN_BRACKET);
				double cy,ma,ye,k; cy=ma=ye=k=0;
				cy=doublething();
				match(COLON);
				ma=doublething();
				match(COLON);
				ye=doublething();
				match(COLON);
				k=doublething();
				match(CLOSE_BRACKET);
				
									 float r,g,b;
									 r=(float) ((1-cy)*(1-k));
									 g=(float) ((1-ma)*(1-k));
									 b=(float) ((1-ye)*(1-k));
									 c= new Color(r,g,b);
									
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return c;
	}
	
	private final Appearance  lineBlock(
		Appearance app
	) throws RecognitionException, TokenStreamException {
		Appearance app2;
		
		
		app2=MathematicaHelper.copyApp(app);
		Color plC=MathematicaHelper.getPLColor(app2,plCDefault);						// Punkt/Linienfarbe
		List<double[]> coordinates= new LinkedList<double[]>();// alle Punkte in einer Liste
		List<double[]> line=new LinkedList<double[]>();					// alle Punkte einer Linie
		List<Color> colors= new LinkedList<Color>();// FarbListe
		int count=0;								// Anzahl aller bisher gesammelten Punkte
		int[] lineIndices;							// liste aller Indices einer Linie
		List<int[]> linesIndices= new LinkedList<int[]>();			// Liste aller IndiceeListen
		boolean colorFlag=false;
		boolean colorNeeded =false;
		
		
		try {      // for error handling
			match(LITERAL_Line);
			match(OPEN_BRACKET);
			line=lineset();
			
								lineIndices=new int[line.size()];
								int i=0;
								for(double[] d: line ){
									coordinates.add(d);  // Punkte zu einer Liste machen
							    	lineIndices[i]=i;			   // indizirung merken					
									i++;
								}
						    	count=line.size();
								linesIndices.add(lineIndices);
							    colors.add(plC);
							
			match(CLOSE_BRACKET);
			{
			_loop41:
			do {
				if ((LA(1)==COLON) && (_tokenSet_9.member(LA(2)))) {
					match(COLON);
					{
					switch ( LA(1)) {
					case LITERAL_RGBColor:
					case LITERAL_Hue:
					case LITERAL_GrayLevel:
					case LITERAL_CMYKColor:
					{
						{
						plC=color();
						colorFlag=true; app2=MathematicaHelper.setPLColor(app2,plC);
						}
						break;
					}
					case LITERAL_Line:
					{
						{
						match(LITERAL_Line);
						match(OPEN_BRACKET);
						line=lineset();
						if (colorFlag) colorNeeded= true;
						
											lineIndices=new int[line.size()];
											i=0;
											for(double[] d: line ){
												coordinates.add(d);  // Punkte zu einer Liste machen
										    	lineIndices[i]=i+count;			   // indizirung merken					
												i++;
											}
									    	count+=line.size();
											linesIndices.add(lineIndices);
											colors.add(plC);
										
						match(CLOSE_BRACKET);
						}
						break;
					}
					default:
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					}
					}
				}
				else {
					break _loop41;
				}
				
			} while (true);
			}
			
					double [][] data= new double[coordinates.size()][];
					double [][] colorData = new double[linesIndices.size()][];
					i=0;
					for(double[] d: coordinates ){
						data[i]= d;
						i++;
					}
					int[][] indices= new int[linesIndices.size()][];
					i=0;
					for(int[] d: linesIndices){
						indices[i]=d;
						i++;
					}
					i=0;
					for(Color d: colors ){
						colorData[i]=MathematicaHelper.getRGBColor(d);		
						i++;
					}
					IndexedLineSetFactory lineset=new IndexedLineSetFactory();
					lineset.setLineCount(linesIndices.size());
					lineset.setVertexCount(count);
					lineset.setEdgeIndices(indices);
					lineset.setVertexCoordinates(data);
					lineset.update();
					Appearance lineApp =MathematicaHelper.copyApp(app2);
					if (colorNeeded)
						lineset.getIndexedLineSet().setEdgeAttributes(
						 Attribute.COLORS,new DoubleArrayArray.Array( colorData ));
					else	lineApp= MathematicaHelper.setPLColor(lineApp,plC);
					lineset.update();
					SceneGraphComponent geo=new SceneGraphComponent();
					geo.setAppearance(lineApp);
					IndexedLineSet ils=lineset.getIndexedLineSet();
					ils=(IndexedLineSet)RemoveDuplicateInfo.removeDuplicateVertices(ils,Attribute.COLORS);
					geo.setGeometry(ils);
					geo.setName("Lines");
					current.addChild(geo);
				
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app2;
	}
	
	private final Appearance  pointBlock(
		Appearance app
	) throws RecognitionException, TokenStreamException {
		Appearance app2;
		
		
		app2=MathematicaHelper.copyApp(app);
		List<double[]> points= new LinkedList<double[]>(); 
		double[] v;
		List<Color> colors= new LinkedList<Color>();
		Color plC=MathematicaHelper.getPLColor(app2,plCDefault);
		boolean colorFlag=false;
		boolean colorNeeded =false;
		
		
		try {      // for error handling
			{
			match(LITERAL_Point);
			match(OPEN_BRACKET);
			v=new double[3];
			v=vektor();
			points.add(v);
							 colors.add(plC);
			match(CLOSE_BRACKET);
			}
			{
			_loop35:
			do {
				if ((LA(1)==COLON) && (_tokenSet_10.member(LA(2)))) {
					match(COLON);
					{
					switch ( LA(1)) {
					case LITERAL_RGBColor:
					case LITERAL_Hue:
					case LITERAL_GrayLevel:
					case LITERAL_CMYKColor:
					{
						plC=color();
						colorFlag=true; app2=MathematicaHelper.setPLColor(app2,plC);
						break;
					}
					case LITERAL_Point:
					{
						{
						match(LITERAL_Point);
						if (colorFlag) colorNeeded= true;
						match(OPEN_BRACKET);
						v=new double [3];
						v=vektor();
						points.add(v);
										 colors.add(plC);
						match(CLOSE_BRACKET);
						}
						break;
					}
					default:
					{
						throw new NoViableAltException(LT(1), getFilename());
					}
					}
					}
				}
				else {
					break _loop35;
				}
				
			} while (true);
			}
			
					PointSetFactory psf = new PointSetFactory();
					double [][] data = new double [points.size()][];
					double [][] colorData = new double[points.size()][];
					int i=0;
					for(double[] d : points){
						data[i]=d;
						i++;
					}
					i=0;
					for(Color d : colors){
						colorData[i]=MathematicaHelper.getRGBColor(d);
						i++;
					}
					psf.setVertexCount(points.size());
					psf.setVertexCoordinates(data);
					Appearance pointApp =MathematicaHelper.copyApp(app2);
				    if (colorNeeded) 			// brauchen wir eine Farbliste?
						psf.setVertexColors(colorData);
					else
						pointApp= MathematicaHelper.setPLColor(pointApp,plC);
					psf.update();
					SceneGraphComponent geo=new SceneGraphComponent();
			//		pointApp.setAttribute(CommonAttributes.SPHERES_DRAW, true);
					geo.setAppearance(pointApp);
					geo.setGeometry(psf.getPointSet());
					geo.setName("Points");
					current.addChild(geo);
				
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app2;
	}
	
	private final void text(
		Appearance app
	) throws RecognitionException, TokenStreamException {
		
		Token  s = null;
		double[] v=new double[3]; String t;
		
		try {      // for error handling
			match(LITERAL_Text);
			match(OPEN_BRACKET);
			s = LT(1);
			match(STRING);
			match(COLON);
			v=vektordata();
			match(CLOSE_BRACKET);
			
								 // realisiert durch ein einelementiges Pointset mit einem LabelPunkt 
								 // mit verschwindend kleinem Radius!
								 t=s.getText();
								 PointSetFactory psf = new PointSetFactory();
								 double [][] data = new double [1][];
								 data[0]=v;
								 psf.setVertexCount(1);
								 psf.setVertexCoordinates(data);
								 String [] labs= new String[1];
								 labs[0]=s.getText();
								 psf.setVertexLabels(labs);
								 psf.update();
					
								 SceneGraphComponent geo=new SceneGraphComponent();
								 Appearance pointApp =MathematicaHelper.copyApp(app);
								 pointApp.setAttribute(CommonAttributes.SPHERES_DRAW, true);
								 //pointApp.setAttribute(CommonAttributes.VERTEX_DRAW, true);
								 pointApp.setAttribute(CommonAttributes.POINT_RADIUS, 0.0001);
							
								 geo.setAppearance(pointApp);
								 geo.setGeometry(psf.getPointSet());
								 geo.setName("Label");
								 current.addChild(geo);
								
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
	}
	
	private final  Appearance  directiveBlock(
		Appearance appOld
	) throws RecognitionException, TokenStreamException {
		 Appearance app;
		
		app =MathematicaHelper.copyApp(appOld);
		
		try {      // for error handling
			app=directive(app);
			{
			_loop62:
			do {
				if ((LA(1)==COLON) && ((LA(2) >= LITERAL_AbsolutePointSize && LA(2) <= LITERAL_AbsoluteDashing))) {
					match(COLON);
					app=directive(app);
				}
				else {
					break _loop62;
				}
				
			} while (true);
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app;
	}
	
	private final double[]  vektor() throws RecognitionException, TokenStreamException {
		double[] res;
		
		res =new double [3];
		double res1,res2,res3;
		
		try {      // for error handling
			match(OPEN_BRACE);
			res1=doublething();
			match(COLON);
			res2=doublething();
			match(COLON);
			res3=doublething();
			match(CLOSE_BRACE);
			
						 res[0]=res1;
						 res[1]=res2;
						 res[2]=res3;
						 resetBorder (res);
						
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return res;
	}
	
	private final double[]  vektordata() throws RecognitionException, TokenStreamException {
		double[] res;
		
		res =new double [3];
		double res1,res2,res3;
		
		try {      // for error handling
			match(OPEN_BRACE);
			res1=doublething();
			match(COLON);
			res2=doublething();
			match(COLON);
			res3=doublething();
			match(CLOSE_BRACE);
			
						 res[0]=res1;
						 res[1]=res2;
						 res[2]=res3;
						
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_11);
		}
		return res;
	}
	
	private final double  doublething() throws RecognitionException, TokenStreamException {
		double d=0;
		
		
		try {      // for error handling
			d=doubleHelp();
			{
			switch ( LA(1)) {
			case MINUS:
			case PLUS:
			case INTEGER_THING:
			case DOT:
			{
				doubleHelp();
				match(STAR);
				match(LITERAL_I);
				break;
			}
			case CLOSE_BRACE:
			case COLON:
			case CLOSE_BRACKET:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return d;
	}
	
	private final LinkedList<double[]>  lineset() throws RecognitionException, TokenStreamException {
		LinkedList<double[]> v;
		
		
		double [] point =new double[3];
		double [] point2=new double[3];
		double [] point3=new double [3];
		v=new LinkedList<double[]>();
		
		try {      // for error handling
			match(OPEN_BRACE);
			point=vektor();
			
					    v.add(point);
					    point3[0]=point[0];// have to save first point seperate and insert later again to first position (dont ask !)
					    point3[1]=point[1];
					    point3[2]=point[2];		    
						
			{
			_loop57:
			do {
				if ((LA(1)==COLON)) {
					match(COLON);
					point2= new double[3];
								
					point2=vektor();
					
							    v.add(point2);
								
				}
				else {
					break _loop57;
				}
				
			} while (true);
			}
			match(CLOSE_BRACE);
			
					 v.set(0,point3);
					
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_11);
		}
		return v;
	}
	
/** 
* TODO: interpret more directives(do this in mathematica.g)
*/
	private final Appearance  directive(
		Appearance appGiven
	) throws RecognitionException, TokenStreamException {
		Appearance app;
		
		app = MathematicaHelper.copyApp(appGiven); 
		Color col;
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_AbsolutePointSize:
			{
				match(LITERAL_AbsolutePointSize);
				match(OPEN_BRACKET);
				double d=0;
				d=doublething();
				
							app.setAttribute(CommonAttributes.POINT_RADIUS,d/40);
							app.setAttribute(CommonAttributes.POINT_SIZE,d);
							
				match(CLOSE_BRACKET);
				break;
			}
			case LITERAL_AbsoluteThickness:
			{
				match(LITERAL_AbsoluteThickness);
				match(OPEN_BRACKET);
				double d=0;
				d=doublething();
				match(CLOSE_BRACKET);
				
							app.setAttribute(CommonAttributes.TUBE_RADIUS,d/40);
							app.setAttribute(CommonAttributes.LINE_WIDTH,d);
							
				break;
			}
			case LITERAL_Dashing:
			{
				match(LITERAL_Dashing);
				match(OPEN_BRACKET);
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				case COLON:
				case 7:
				case OPEN_BRACKET:
				case LITERAL_Cuboid:
				case LITERAL_Sphere:
				case LITERAL_Cylinder:
				case LITERAL_Text:
				case STRING:
				case LITERAL_Point:
				case LITERAL_Line:
				case LITERAL_Polygon:
				case LITERAL_EdgeForm:
				case LITERAL_SurfaceColor:
				case LITERAL_RGBColor:
				case LITERAL_Hue:
				case LITERAL_GrayLevel:
				case LITERAL_CMYKColor:
				case LITERAL_AbsolutePointSize:
				case LITERAL_AbsoluteThickness:
				case LITERAL_Dashing:
				case LITERAL_FaceForm:
				case LITERAL_PointSize:
				case LITERAL_Thickness:
				case LITERAL_AbsoluteDashing:
				case LITERAL_Boxed:
				case DDOT:
				case LARGER:
				case MINUS:
				case LITERAL_Axes:
				case LITERAL_AxesLabel:
				case LITERAL_Prolog:
				case LITERAL_Epilog:
				case LITERAL_ViewPoint:
				case LITERAL_ViewCenter:
				case LITERAL_FaceGrids:
				case LITERAL_Ticks:
				case LITERAL_TextStyle:
				case LITERAL_BoxRatios:
				case LITERAL_Lighting:
				case LITERAL_LightSources:
				case LITERAL_AmbientLight:
				case LITERAL_AxesEdge:
				case LITERAL_PlotRange:
				case LITERAL_DefaultColor:
				case LITERAL_Background:
				case LITERAL_ColorOutput:
				case LITERAL_AxesStyle:
				case LITERAL_BoxStyle:
				case LITERAL_PlotLabel:
				case LITERAL_AspectRatio:
				case LITERAL_DefaultFont:
				case LITERAL_PlotRegion:
				case LITERAL_ViewVertical:
				case LITERAL_SphericalRegion:
				case LITERAL_Shading:
				case LITERAL_RenderAll:
				case LITERAL_PolygonIntersections:
				case LITERAL_DisplayFunction:
				case 65:
				case LITERAL_ImageSize:
				case LITERAL_FormatType:
				case LPAREN:
				case PLUS:
				case INTEGER_THING:
				case STAR:
				case LITERAL_I:
				case DOT:
				case HAT:
				case BACKS:
				case SLASH:
				case DOLLAR:
				case SMALER:
				case T1:
				case T2:
				case T3:
				case T4:
				case T5:
				case T6:
				case T7:
				case T8:
				case T9:
				case ID:
				case ID_LETTER:
				case DIGIT:
				case ESC:
				case WS_:
				{
					dumb();
					break;
				}
				case CLOSE_BRACKET:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACKET);
				log.fine("Dashing not implemented");
				break;
			}
			case LITERAL_FaceForm:
			{
				match(LITERAL_FaceForm);
				match(OPEN_BRACKET);
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				case COLON:
				case 7:
				case OPEN_BRACKET:
				case LITERAL_Cuboid:
				case LITERAL_Sphere:
				case LITERAL_Cylinder:
				case LITERAL_Text:
				case STRING:
				case LITERAL_Point:
				case LITERAL_Line:
				case LITERAL_Polygon:
				case LITERAL_EdgeForm:
				case LITERAL_SurfaceColor:
				case LITERAL_RGBColor:
				case LITERAL_Hue:
				case LITERAL_GrayLevel:
				case LITERAL_CMYKColor:
				case LITERAL_AbsolutePointSize:
				case LITERAL_AbsoluteThickness:
				case LITERAL_Dashing:
				case LITERAL_FaceForm:
				case LITERAL_PointSize:
				case LITERAL_Thickness:
				case LITERAL_AbsoluteDashing:
				case LITERAL_Boxed:
				case DDOT:
				case LARGER:
				case MINUS:
				case LITERAL_Axes:
				case LITERAL_AxesLabel:
				case LITERAL_Prolog:
				case LITERAL_Epilog:
				case LITERAL_ViewPoint:
				case LITERAL_ViewCenter:
				case LITERAL_FaceGrids:
				case LITERAL_Ticks:
				case LITERAL_TextStyle:
				case LITERAL_BoxRatios:
				case LITERAL_Lighting:
				case LITERAL_LightSources:
				case LITERAL_AmbientLight:
				case LITERAL_AxesEdge:
				case LITERAL_PlotRange:
				case LITERAL_DefaultColor:
				case LITERAL_Background:
				case LITERAL_ColorOutput:
				case LITERAL_AxesStyle:
				case LITERAL_BoxStyle:
				case LITERAL_PlotLabel:
				case LITERAL_AspectRatio:
				case LITERAL_DefaultFont:
				case LITERAL_PlotRegion:
				case LITERAL_ViewVertical:
				case LITERAL_SphericalRegion:
				case LITERAL_Shading:
				case LITERAL_RenderAll:
				case LITERAL_PolygonIntersections:
				case LITERAL_DisplayFunction:
				case 65:
				case LITERAL_ImageSize:
				case LITERAL_FormatType:
				case LPAREN:
				case PLUS:
				case INTEGER_THING:
				case STAR:
				case LITERAL_I:
				case DOT:
				case HAT:
				case BACKS:
				case SLASH:
				case DOLLAR:
				case SMALER:
				case T1:
				case T2:
				case T3:
				case T4:
				case T5:
				case T6:
				case T7:
				case T8:
				case T9:
				case ID:
				case ID_LETTER:
				case DIGIT:
				case ESC:
				case WS_:
				{
					dumb();
					break;
				}
				case CLOSE_BRACKET:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACKET);
				log.fine("FaceForm not implemented");
				break;
			}
			case LITERAL_PointSize:
			{
				match(LITERAL_PointSize);
				match(OPEN_BRACKET);
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				case COLON:
				case 7:
				case OPEN_BRACKET:
				case LITERAL_Cuboid:
				case LITERAL_Sphere:
				case LITERAL_Cylinder:
				case LITERAL_Text:
				case STRING:
				case LITERAL_Point:
				case LITERAL_Line:
				case LITERAL_Polygon:
				case LITERAL_EdgeForm:
				case LITERAL_SurfaceColor:
				case LITERAL_RGBColor:
				case LITERAL_Hue:
				case LITERAL_GrayLevel:
				case LITERAL_CMYKColor:
				case LITERAL_AbsolutePointSize:
				case LITERAL_AbsoluteThickness:
				case LITERAL_Dashing:
				case LITERAL_FaceForm:
				case LITERAL_PointSize:
				case LITERAL_Thickness:
				case LITERAL_AbsoluteDashing:
				case LITERAL_Boxed:
				case DDOT:
				case LARGER:
				case MINUS:
				case LITERAL_Axes:
				case LITERAL_AxesLabel:
				case LITERAL_Prolog:
				case LITERAL_Epilog:
				case LITERAL_ViewPoint:
				case LITERAL_ViewCenter:
				case LITERAL_FaceGrids:
				case LITERAL_Ticks:
				case LITERAL_TextStyle:
				case LITERAL_BoxRatios:
				case LITERAL_Lighting:
				case LITERAL_LightSources:
				case LITERAL_AmbientLight:
				case LITERAL_AxesEdge:
				case LITERAL_PlotRange:
				case LITERAL_DefaultColor:
				case LITERAL_Background:
				case LITERAL_ColorOutput:
				case LITERAL_AxesStyle:
				case LITERAL_BoxStyle:
				case LITERAL_PlotLabel:
				case LITERAL_AspectRatio:
				case LITERAL_DefaultFont:
				case LITERAL_PlotRegion:
				case LITERAL_ViewVertical:
				case LITERAL_SphericalRegion:
				case LITERAL_Shading:
				case LITERAL_RenderAll:
				case LITERAL_PolygonIntersections:
				case LITERAL_DisplayFunction:
				case 65:
				case LITERAL_ImageSize:
				case LITERAL_FormatType:
				case LPAREN:
				case PLUS:
				case INTEGER_THING:
				case STAR:
				case LITERAL_I:
				case DOT:
				case HAT:
				case BACKS:
				case SLASH:
				case DOLLAR:
				case SMALER:
				case T1:
				case T2:
				case T3:
				case T4:
				case T5:
				case T6:
				case T7:
				case T8:
				case T9:
				case ID:
				case ID_LETTER:
				case DIGIT:
				case ESC:
				case WS_:
				{
					dumb();
					break;
				}
				case CLOSE_BRACKET:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACKET);
				log.fine("PointSize not implemented");
				break;
			}
			case LITERAL_Thickness:
			{
				match(LITERAL_Thickness);
				match(OPEN_BRACKET);
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				case COLON:
				case 7:
				case OPEN_BRACKET:
				case LITERAL_Cuboid:
				case LITERAL_Sphere:
				case LITERAL_Cylinder:
				case LITERAL_Text:
				case STRING:
				case LITERAL_Point:
				case LITERAL_Line:
				case LITERAL_Polygon:
				case LITERAL_EdgeForm:
				case LITERAL_SurfaceColor:
				case LITERAL_RGBColor:
				case LITERAL_Hue:
				case LITERAL_GrayLevel:
				case LITERAL_CMYKColor:
				case LITERAL_AbsolutePointSize:
				case LITERAL_AbsoluteThickness:
				case LITERAL_Dashing:
				case LITERAL_FaceForm:
				case LITERAL_PointSize:
				case LITERAL_Thickness:
				case LITERAL_AbsoluteDashing:
				case LITERAL_Boxed:
				case DDOT:
				case LARGER:
				case MINUS:
				case LITERAL_Axes:
				case LITERAL_AxesLabel:
				case LITERAL_Prolog:
				case LITERAL_Epilog:
				case LITERAL_ViewPoint:
				case LITERAL_ViewCenter:
				case LITERAL_FaceGrids:
				case LITERAL_Ticks:
				case LITERAL_TextStyle:
				case LITERAL_BoxRatios:
				case LITERAL_Lighting:
				case LITERAL_LightSources:
				case LITERAL_AmbientLight:
				case LITERAL_AxesEdge:
				case LITERAL_PlotRange:
				case LITERAL_DefaultColor:
				case LITERAL_Background:
				case LITERAL_ColorOutput:
				case LITERAL_AxesStyle:
				case LITERAL_BoxStyle:
				case LITERAL_PlotLabel:
				case LITERAL_AspectRatio:
				case LITERAL_DefaultFont:
				case LITERAL_PlotRegion:
				case LITERAL_ViewVertical:
				case LITERAL_SphericalRegion:
				case LITERAL_Shading:
				case LITERAL_RenderAll:
				case LITERAL_PolygonIntersections:
				case LITERAL_DisplayFunction:
				case 65:
				case LITERAL_ImageSize:
				case LITERAL_FormatType:
				case LPAREN:
				case PLUS:
				case INTEGER_THING:
				case STAR:
				case LITERAL_I:
				case DOT:
				case HAT:
				case BACKS:
				case SLASH:
				case DOLLAR:
				case SMALER:
				case T1:
				case T2:
				case T3:
				case T4:
				case T5:
				case T6:
				case T7:
				case T8:
				case T9:
				case ID:
				case ID_LETTER:
				case DIGIT:
				case ESC:
				case WS_:
				{
					dumb();
					break;
				}
				case CLOSE_BRACKET:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACKET);
				log.fine("Thicknes not implemented");
				break;
			}
			case LITERAL_AbsoluteDashing:
			{
				match(LITERAL_AbsoluteDashing);
				match(OPEN_BRACKET);
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				case COLON:
				case 7:
				case OPEN_BRACKET:
				case LITERAL_Cuboid:
				case LITERAL_Sphere:
				case LITERAL_Cylinder:
				case LITERAL_Text:
				case STRING:
				case LITERAL_Point:
				case LITERAL_Line:
				case LITERAL_Polygon:
				case LITERAL_EdgeForm:
				case LITERAL_SurfaceColor:
				case LITERAL_RGBColor:
				case LITERAL_Hue:
				case LITERAL_GrayLevel:
				case LITERAL_CMYKColor:
				case LITERAL_AbsolutePointSize:
				case LITERAL_AbsoluteThickness:
				case LITERAL_Dashing:
				case LITERAL_FaceForm:
				case LITERAL_PointSize:
				case LITERAL_Thickness:
				case LITERAL_AbsoluteDashing:
				case LITERAL_Boxed:
				case DDOT:
				case LARGER:
				case MINUS:
				case LITERAL_Axes:
				case LITERAL_AxesLabel:
				case LITERAL_Prolog:
				case LITERAL_Epilog:
				case LITERAL_ViewPoint:
				case LITERAL_ViewCenter:
				case LITERAL_FaceGrids:
				case LITERAL_Ticks:
				case LITERAL_TextStyle:
				case LITERAL_BoxRatios:
				case LITERAL_Lighting:
				case LITERAL_LightSources:
				case LITERAL_AmbientLight:
				case LITERAL_AxesEdge:
				case LITERAL_PlotRange:
				case LITERAL_DefaultColor:
				case LITERAL_Background:
				case LITERAL_ColorOutput:
				case LITERAL_AxesStyle:
				case LITERAL_BoxStyle:
				case LITERAL_PlotLabel:
				case LITERAL_AspectRatio:
				case LITERAL_DefaultFont:
				case LITERAL_PlotRegion:
				case LITERAL_ViewVertical:
				case LITERAL_SphericalRegion:
				case LITERAL_Shading:
				case LITERAL_RenderAll:
				case LITERAL_PolygonIntersections:
				case LITERAL_DisplayFunction:
				case 65:
				case LITERAL_ImageSize:
				case LITERAL_FormatType:
				case LPAREN:
				case PLUS:
				case INTEGER_THING:
				case STAR:
				case LITERAL_I:
				case DOT:
				case HAT:
				case BACKS:
				case SLASH:
				case DOLLAR:
				case SMALER:
				case T1:
				case T2:
				case T3:
				case T4:
				case T5:
				case T6:
				case T7:
				case T8:
				case T9:
				case ID:
				case ID_LETTER:
				case DIGIT:
				case ESC:
				case WS_:
				{
					dumb();
					break;
				}
				case CLOSE_BRACKET:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACKET);
				log.fine("AbsoluteDashing not implemented");
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_4);
		}
		return app;
	}
	
	private final void dumb() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			switch ( LA(1)) {
			case COLON:
			case 7:
			case LITERAL_Cuboid:
			case LITERAL_Sphere:
			case LITERAL_Cylinder:
			case LITERAL_Text:
			case STRING:
			case LITERAL_Point:
			case LITERAL_Line:
			case LITERAL_Polygon:
			case LITERAL_EdgeForm:
			case LITERAL_SurfaceColor:
			case LITERAL_RGBColor:
			case LITERAL_Hue:
			case LITERAL_GrayLevel:
			case LITERAL_CMYKColor:
			case LITERAL_AbsolutePointSize:
			case LITERAL_AbsoluteThickness:
			case LITERAL_Dashing:
			case LITERAL_FaceForm:
			case LITERAL_PointSize:
			case LITERAL_Thickness:
			case LITERAL_AbsoluteDashing:
			case LITERAL_Boxed:
			case DDOT:
			case LARGER:
			case MINUS:
			case LITERAL_Axes:
			case LITERAL_AxesLabel:
			case LITERAL_Prolog:
			case LITERAL_Epilog:
			case LITERAL_ViewPoint:
			case LITERAL_ViewCenter:
			case LITERAL_FaceGrids:
			case LITERAL_Ticks:
			case LITERAL_TextStyle:
			case LITERAL_BoxRatios:
			case LITERAL_Lighting:
			case LITERAL_LightSources:
			case LITERAL_AmbientLight:
			case LITERAL_AxesEdge:
			case LITERAL_PlotRange:
			case LITERAL_DefaultColor:
			case LITERAL_Background:
			case LITERAL_ColorOutput:
			case LITERAL_AxesStyle:
			case LITERAL_BoxStyle:
			case LITERAL_PlotLabel:
			case LITERAL_AspectRatio:
			case LITERAL_DefaultFont:
			case LITERAL_PlotRegion:
			case LITERAL_ViewVertical:
			case LITERAL_SphericalRegion:
			case LITERAL_Shading:
			case LITERAL_RenderAll:
			case LITERAL_PolygonIntersections:
			case LITERAL_DisplayFunction:
			case 65:
			case LITERAL_ImageSize:
			case LITERAL_FormatType:
			case PLUS:
			case INTEGER_THING:
			case STAR:
			case LITERAL_I:
			case DOT:
			case HAT:
			case BACKS:
			case SLASH:
			case DOLLAR:
			case SMALER:
			case T1:
			case T2:
			case T3:
			case T4:
			case T5:
			case T6:
			case T7:
			case T8:
			case T9:
			case ID:
			case ID_LETTER:
			case DIGIT:
			case ESC:
			case WS_:
			{
				{
				{
				int _cnt138=0;
				_loop138:
				do {
					if ((_tokenSet_12.member(LA(1))) && ((LA(2) >= OPEN_BRACE && LA(2) <= WS_))) {
						{
						match(_tokenSet_12);
						}
					}
					else {
						if ( _cnt138>=1 ) { break _loop138; } else {throw new NoViableAltException(LT(1), getFilename());}
					}
					
					_cnt138++;
				} while (true);
				}
				{
				if ((LA(1)==OPEN_BRACE) && (_tokenSet_13.member(LA(2)))) {
					match(OPEN_BRACE);
					{
					_loop141:
					do {
						if ((_tokenSet_6.member(LA(1)))) {
							dumb();
						}
						else {
							break _loop141;
						}
						
					} while (true);
					}
					match(CLOSE_BRACE);
				}
				else if ((LA(1)==OPEN_BRACKET) && (_tokenSet_14.member(LA(2)))) {
					match(OPEN_BRACKET);
					{
					_loop143:
					do {
						if ((_tokenSet_6.member(LA(1)))) {
							dumb();
						}
						else {
							break _loop143;
						}
						
					} while (true);
					}
					match(CLOSE_BRACKET);
				}
				else if ((LA(1)==LPAREN) && (_tokenSet_15.member(LA(2)))) {
					match(LPAREN);
					{
					_loop145:
					do {
						if ((_tokenSet_6.member(LA(1)))) {
							dumb();
						}
						else {
							break _loop145;
						}
						
					} while (true);
					}
					match(RPAREN);
				}
				else if (((LA(1) >= OPEN_BRACE && LA(1) <= WS_)) && ((LA(2) >= OPEN_BRACE && LA(2) <= WS_))) {
				}
				else {
					throw new NoViableAltException(LT(1), getFilename());
				}
				
				}
				}
				break;
			}
			case OPEN_BRACE:
			case OPEN_BRACKET:
			case LPAREN:
			{
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				{
					match(OPEN_BRACE);
					{
					_loop148:
					do {
						if ((_tokenSet_6.member(LA(1)))) {
							dumb();
						}
						else {
							break _loop148;
						}
						
					} while (true);
					}
					match(CLOSE_BRACE);
					break;
				}
				case OPEN_BRACKET:
				{
					match(OPEN_BRACKET);
					{
					_loop150:
					do {
						if ((_tokenSet_6.member(LA(1)))) {
							dumb();
						}
						else {
							break _loop150;
						}
						
					} while (true);
					}
					match(CLOSE_BRACKET);
					break;
				}
				case LPAREN:
				{
					match(LPAREN);
					{
					_loop152:
					do {
						if ((_tokenSet_6.member(LA(1)))) {
							dumb();
						}
						else {
							break _loop152;
						}
						
					} while (true);
					}
					match(RPAREN);
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_16);
		}
	}
	
	private final void optionen() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			switch ( LA(1)) {
			case OPEN_BRACE:
			{
				match(OPEN_BRACE);
				{
				switch ( LA(1)) {
				case OPEN_BRACE:
				case LITERAL_Boxed:
				case LITERAL_Axes:
				case LITERAL_AxesLabel:
				case LITERAL_Prolog:
				case LITERAL_Epilog:
				case LITERAL_ViewPoint:
				case LITERAL_ViewCenter:
				case LITERAL_FaceGrids:
				case LITERAL_Ticks:
				case LITERAL_TextStyle:
				case LITERAL_BoxRatios:
				case LITERAL_Lighting:
				case LITERAL_LightSources:
				case LITERAL_AmbientLight:
				case LITERAL_AxesEdge:
				case LITERAL_PlotRange:
				case LITERAL_DefaultColor:
				case LITERAL_Background:
				case LITERAL_ColorOutput:
				case LITERAL_AxesStyle:
				case LITERAL_BoxStyle:
				case LITERAL_PlotLabel:
				case LITERAL_AspectRatio:
				case LITERAL_DefaultFont:
				case LITERAL_PlotRegion:
				case LITERAL_ViewVertical:
				case LITERAL_SphericalRegion:
				case LITERAL_Shading:
				case LITERAL_RenderAll:
				case LITERAL_PolygonIntersections:
				case LITERAL_DisplayFunction:
				case 65:
				case LITERAL_ImageSize:
				case LITERAL_FormatType:
				{
					optionen();
					{
					_loop72:
					do {
						if ((LA(1)==COLON)) {
							match(COLON);
							optionen();
						}
						else {
							break _loop72;
						}
						
					} while (true);
					}
					break;
				}
				case CLOSE_BRACE:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				match(CLOSE_BRACE);
				break;
			}
			case LITERAL_Boxed:
			case LITERAL_Axes:
			case LITERAL_AxesLabel:
			case LITERAL_Prolog:
			case LITERAL_Epilog:
			case LITERAL_ViewPoint:
			case LITERAL_ViewCenter:
			case LITERAL_FaceGrids:
			case LITERAL_Ticks:
			case LITERAL_TextStyle:
			case LITERAL_BoxRatios:
			case LITERAL_Lighting:
			case LITERAL_LightSources:
			case LITERAL_AmbientLight:
			case LITERAL_AxesEdge:
			case LITERAL_PlotRange:
			case LITERAL_DefaultColor:
			case LITERAL_Background:
			case LITERAL_ColorOutput:
			case LITERAL_AxesStyle:
			case LITERAL_BoxStyle:
			case LITERAL_PlotLabel:
			case LITERAL_AspectRatio:
			case LITERAL_DefaultFont:
			case LITERAL_PlotRegion:
			case LITERAL_ViewVertical:
			case LITERAL_SphericalRegion:
			case LITERAL_Shading:
			case LITERAL_RenderAll:
			case LITERAL_PolygonIntersections:
			case LITERAL_DisplayFunction:
			case 65:
			case LITERAL_ImageSize:
			case LITERAL_FormatType:
			{
				optionPrimitive();
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
	}
	
/** 
* TODO: interpret more Options(do this in mathematica.g)
*/
	private final void optionPrimitive() throws RecognitionException, TokenStreamException {
		
		
		try {      // for error handling
			switch ( LA(1)) {
			case LITERAL_Boxed:
			{
				match(LITERAL_Boxed);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Boxed not implemented");
				break;
			}
			case LITERAL_Axes:
			{
				match(LITERAL_Axes);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Axes not implemented");
				break;
			}
			case LITERAL_AxesLabel:
			{
				match(LITERAL_AxesLabel);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" AxesLabel not implemented");
				break;
			}
			case LITERAL_Prolog:
			{
				match(LITERAL_Prolog);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Prolog not implemented");
				break;
			}
			case LITERAL_Epilog:
			{
				match(LITERAL_Epilog);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Epilog not implemented");
				break;
			}
			case LITERAL_ViewPoint:
			{
				match(LITERAL_ViewPoint);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" ViewPoint not implemented");
				break;
			}
			case LITERAL_ViewCenter:
			{
				match(LITERAL_ViewCenter);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" ViewCenter not implemented");
				break;
			}
			case LITERAL_FaceGrids:
			{
				match(LITERAL_FaceGrids);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" FaceGrids not implemented");
				break;
			}
			case LITERAL_Ticks:
			{
				match(LITERAL_Ticks);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Ticks not implemented");
				break;
			}
			case LITERAL_TextStyle:
			{
				match(LITERAL_TextStyle);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" TextStyle not implemented");
				break;
			}
			case LITERAL_BoxRatios:
			{
				match(LITERAL_BoxRatios);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" BoxRatios not implemented");
				break;
			}
			case LITERAL_Lighting:
			{
				match(LITERAL_Lighting);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Lighting not implemented");
				break;
			}
			case LITERAL_LightSources:
			{
				match(LITERAL_LightSources);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" LightSources not implemented");
				break;
			}
			case LITERAL_AmbientLight:
			{
				match(LITERAL_AmbientLight);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" AmbientLight not implemented");
				break;
			}
			case LITERAL_AxesEdge:
			{
				match(LITERAL_AxesEdge);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" AxesEdge not implemented");
				break;
			}
			case LITERAL_PlotRange:
			{
				match(LITERAL_PlotRange);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" PlotRange not implemented");
				break;
			}
			case LITERAL_DefaultColor:
			{
				match(LITERAL_DefaultColor);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" DefaultColor not implemented");
				break;
			}
			case LITERAL_Background:
			{
				match(LITERAL_Background);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Background not implemented");
				break;
			}
			case LITERAL_ColorOutput:
			{
				match(LITERAL_ColorOutput);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" ColorOutput not implemented");
				break;
			}
			case LITERAL_AxesStyle:
			{
				match(LITERAL_AxesStyle);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" AxesStyle not implemented");
				break;
			}
			case LITERAL_BoxStyle:
			{
				match(LITERAL_BoxStyle);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" BoxStyle not implemented");
				break;
			}
			case LITERAL_PlotLabel:
			{
				match(LITERAL_PlotLabel);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" PlotLabel not implemented");
				break;
			}
			case LITERAL_AspectRatio:
			{
				match(LITERAL_AspectRatio);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" AspectRatio not implemented");
				break;
			}
			case LITERAL_DefaultFont:
			{
				match(LITERAL_DefaultFont);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" DefaultFont not implemented");
				break;
			}
			case LITERAL_PlotRegion:
			{
				match(LITERAL_PlotRegion);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" PlotRegion not implemented");
				break;
			}
			case LITERAL_ViewVertical:
			{
				match(LITERAL_ViewVertical);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" ViewVertical not implemented");
				break;
			}
			case LITERAL_SphericalRegion:
			{
				match(LITERAL_SphericalRegion);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" SphericalRegion not implemented");
				break;
			}
			case LITERAL_Shading:
			{
				match(LITERAL_Shading);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Shading not implemented");
				break;
			}
			case LITERAL_RenderAll:
			{
				match(LITERAL_RenderAll);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" RenderAll not implemented");
				break;
			}
			case LITERAL_PolygonIntersections:
			{
				match(LITERAL_PolygonIntersections);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" PolygonIntersections not implemented");
				break;
			}
			case LITERAL_DisplayFunction:
			{
				match(LITERAL_DisplayFunction);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" DisplayFunction not implemented");
				break;
			}
			case 65:
			{
				match(65);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" Plot3Matrix not implemented");
				break;
			}
			case LITERAL_ImageSize:
			{
				match(LITERAL_ImageSize);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" ImageSize not implemented");
				break;
			}
			case LITERAL_FormatType:
			{
				match(LITERAL_FormatType);
				{
				switch ( LA(1)) {
				case DDOT:
				{
					match(DDOT);
					match(LARGER);
					egal();
					break;
				}
				case MINUS:
				{
					match(MINUS);
					match(LARGER);
					egal();
					break;
				}
				default:
				{
					throw new NoViableAltException(LT(1), getFilename());
				}
				}
				}
				log.fine(" FormatType not implemented");
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_2);
		}
	}
	
	private final int  integerthing() throws RecognitionException, TokenStreamException {
		int i;
		
		Token  s = null;
		i=0;String sig="";
		
		try {      // for error handling
			{
			switch ( LA(1)) {
			case PLUS:
			{
				match(PLUS);
				break;
			}
			case MINUS:
			{
				match(MINUS);
				sig="-";
				break;
			}
			case INTEGER_THING:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			s = LT(1);
			match(INTEGER_THING);
			i=Integer.parseInt(sig + s.getText());
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_0);
		}
		return i;
	}
	
	private final double  doubleHelp() throws RecognitionException, TokenStreamException {
		double d=0;
		
		Token  s = null;
		Token  s2 = null;
		Token  s3 = null;
		double e=0; String sig="";
		
		try {      // for error handling
			{
			switch ( LA(1)) {
			case PLUS:
			{
				match(PLUS);
				break;
			}
			case MINUS:
			{
				match(MINUS);
				sig="-";
				break;
			}
			case INTEGER_THING:
			case DOT:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			{
			switch ( LA(1)) {
			case INTEGER_THING:
			{
				s = LT(1);
				match(INTEGER_THING);
				d=Double.parseDouble(sig + s.getText());
				{
				if ((LA(1)==DOT) && (_tokenSet_17.member(LA(2)))) {
					match(DOT);
					{
					if ((LA(1)==INTEGER_THING) && (_tokenSet_17.member(LA(2)))) {
						s2 = LT(1);
						match(INTEGER_THING);
						d=Double.parseDouble(sig + s.getText()+ "." + s2.getText());
					}
					else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_18.member(LA(2)))) {
					}
					else {
						throw new NoViableAltException(LT(1), getFilename());
					}
					
					}
				}
				else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_18.member(LA(2)))) {
				}
				else {
					throw new NoViableAltException(LT(1), getFilename());
				}
				
				}
				break;
			}
			case DOT:
			{
				match(DOT);
				s3 = LT(1);
				match(INTEGER_THING);
				d=Double.parseDouble(sig + "0." + s3.getText());
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			{
			if ((LA(1)==STAR) && (LA(2)==HAT)) {
				e=exponent_thing();
				d=d*Math.pow(10,e);
			}
			else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_19.member(LA(2)))) {
			}
			else {
				throw new NoViableAltException(LT(1), getFilename());
			}
			
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_17);
		}
		return d;
	}
	
	private final int  exponent_thing() throws RecognitionException, TokenStreamException {
		int e;
		
		Token  s = null;
		e=0; String sig="";
		
		try {      // for error handling
			match(STAR);
			match(HAT);
			{
			switch ( LA(1)) {
			case PLUS:
			{
				match(PLUS);
				break;
			}
			case MINUS:
			{
				match(MINUS);
				sig="-";
				break;
			}
			case INTEGER_THING:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			}
			}
			s = LT(1);
			match(INTEGER_THING);
			e=Integer.parseInt(sig + s.getText() );
		}
		catch (RecognitionException ex) {
			reportError(ex);
			recover(ex,_tokenSet_17);
		}
		return e;
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"OPEN_BRACE",
		"CLOSE_BRACE",
		"COLON",
		"\"Graphics3D\"",
		"OPEN_BRACKET",
		"CLOSE_BRACKET",
		"\"Cuboid\"",
		"\"Sphere\"",
		"\"Cylinder\"",
		"\"Text\"",
		"STRING",
		"\"Point\"",
		"\"Line\"",
		"\"Polygon\"",
		"\"EdgeForm\"",
		"\"SurfaceColor\"",
		"\"RGBColor\"",
		"\"Hue\"",
		"\"GrayLevel\"",
		"\"CMYKColor\"",
		"\"AbsolutePointSize\"",
		"\"AbsoluteThickness\"",
		"\"Dashing\"",
		"\"FaceForm\"",
		"\"PointSize\"",
		"\"Thickness\"",
		"\"AbsoluteDashing\"",
		"\"Boxed\"",
		"DDOT",
		"LARGER",
		"MINUS",
		"\"Axes\"",
		"\"AxesLabel\"",
		"\"Prolog\"",
		"\"Epilog\"",
		"\"ViewPoint\"",
		"\"ViewCenter\"",
		"\"FaceGrids\"",
		"\"Ticks\"",
		"\"TextStyle\"",
		"\"BoxRatios\"",
		"\"Lighting\"",
		"\"LightSources\"",
		"\"AmbientLight\"",
		"\"AxesEdge\"",
		"\"PlotRange\"",
		"\"DefaultColor\"",
		"\"Background\"",
		"\"ColorOutput\"",
		"\"AxesStyle\"",
		"\"BoxStyle\"",
		"\"PlotLabel\"",
		"\"AspectRatio\"",
		"\"DefaultFont\"",
		"\"PlotRegion\"",
		"\"ViewVertical\"",
		"\"SphericalRegion\"",
		"\"Shading\"",
		"\"RenderAll\"",
		"\"PolygonIntersections\"",
		"\"DisplayFunction\"",
		"\"Plot3Matrix\"",
		"\"ImageSize\"",
		"\"FormatType\"",
		"LPAREN",
		"RPAREN",
		"PLUS",
		"INTEGER_THING",
		"STAR",
		"\"I\"",
		"DOT",
		"HAT",
		"BACKS",
		"SLASH",
		"DOLLAR",
		"SMALER",
		"T1",
		"T2",
		"T3",
		"T4",
		"T5",
		"T6",
		"T7",
		"T8",
		"T9",
		"an identifier",
		"ID_LETTER",
		"DIGIT",
		"ESC",
		"WS_"
	};
	
	private static final long[] mk_tokenSet_0() {
		long[] data = { 2L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
	private static final long[] mk_tokenSet_1() {
		long[] data = { 98L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
	private static final long[] mk_tokenSet_2() {
		long[] data = { 96L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
	private static final long[] mk_tokenSet_3() {
		long[] data = { 32L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
	private static final long[] mk_tokenSet_4() {
		long[] data = { 608L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
	private static final long[] mk_tokenSet_5() {
		long[] data = new long[8];
		data[0]=-384L;
		data[1]=1073741807L;
		return data;
	}
	public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
	private static final long[] mk_tokenSet_6() {
		long[] data = new long[8];
		data[0]=-560L;
		data[1]=1073741791L;
		return data;
	}
	public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
	private static final long[] mk_tokenSet_7() {
		long[] data = new long[8];
		data[0]=-14L;
		data[1]=1073741823L;
		return data;
	}
	public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
	private static final long[] mk_tokenSet_8() {
		long[] data = { -32212254606L, 15L, 0L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
	private static final long[] mk_tokenSet_9() {
		long[] data = { 15794176L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9());
	private static final long[] mk_tokenSet_10() {
		long[] data = { 15761408L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10());
	private static final long[] mk_tokenSet_11() {
		long[] data = { 512L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11());
	private static final long[] mk_tokenSet_12() {
		long[] data = new long[8];
		data[0]=-832L;
		data[1]=1073741775L;
		return data;
	}
	public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12());
	private static final long[] mk_tokenSet_13() {
		long[] data = new long[8];
		data[0]=-528L;
		data[1]=1073741791L;
		return data;
	}
	public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13());
	private static final long[] mk_tokenSet_14() {
		long[] data = new long[8];
		data[0]=-48L;
		data[1]=1073741791L;
		return data;
	}
	public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14());
	private static final long[] mk_tokenSet_15() {
		long[] data = new long[8];
		data[0]=-560L;
		data[1]=1073741823L;
		return data;
	}
	public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15());
	private static final long[] mk_tokenSet_16() {
		long[] data = new long[8];
		data[0]=-16L;
		data[1]=1073741823L;
		return data;
	}
	public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16());
	private static final long[] mk_tokenSet_17() {
		long[] data = { 17179869792L, 1472L, 0L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17());
	private static final long[] mk_tokenSet_18() {
		long[] data = { 17179869792L, 4032L, 0L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18());
	private static final long[] mk_tokenSet_19() {
		long[] data = { 17179869792L, 1984L, 0L, 0L};
		return data;
	}
	public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19());
	
	}
