[SCM] applications.git branch, master, updated. 2efea59beb921a851d397490044722ca3c1aa9b1
ontologiae
ontologiae at ordinateur-de-ontologiae-3.local
Tue Apr 6 09:43:12 UTC 2010
The following commit has been merged in the master branch:
commit 2efea59beb921a851d397490044722ca3c1aa9b1
Author: ontologiae <ontologiae at ordinateur-de-ontologiae-3.local>
Date: Tue Apr 6 11:42:51 2010 +0200
Java2Xml generator compilable
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Exceptions/JXMLException.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Exceptions/JXMLException.class
deleted file mode 100644
index 0e6710a..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Exceptions/JXMLException.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Exceptions/JXMLException.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Exceptions/JXMLException.java
deleted file mode 100644
index dc8c64f..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Exceptions/JXMLException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
-*
-* This file is part of java2XML
-* Copyright (C) Harsh Jain, All Rights Reserved.
-* Email : harsh at harshjain.com Website : http://www.harshjain.com/
-*
-* This software is provided 'as-is', without any express or implied warranty.
-* In no event will the authors be held liable for any damages arising from the
-* use of this software.
-*
-* Permission is granted to anyone to use this software for any non-commercial
-* applications freely, subject to the following restriction.
-*
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software in
-* a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-*
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-*
-* 3. This notice must not be removed or altered from any source distribution.
-*
-* For using this software for commercial purpose please contact the author.
-*
-*
-*/
-
-package harsh.javatoxml.Exceptions;
-
-/**
- * @author harsh
- *
- *
- */
-public class JXMLException extends Exception {
-
- /**
- *
- */
- public JXMLException(String message) {
- super(message);
- }
-
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Java2XML.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Java2XML.class
deleted file mode 100644
index 03a411b..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Java2XML.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Java2XML.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Java2XML.java
deleted file mode 100644
index 03bfa80..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/Java2XML.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
-*
-* This file is part of java2XML
-* Copyright (C) Harsh Jain, All Rights Reserved.
-* Email : harsh at harshjain.com Website : http://www.harshjain.com/
-*
-* This software is provided 'as-is', without any express or implied warranty.
-* In no event will the authors be held liable for any damages arising from the
-* use of this software.
-*
-* Permission is granted to anyone to use this software for any non-commercial
-* applications freely, subject to the following restriction.
-*
-* 1. The origin of this software must not be misrepresented; you must not
-* claim that you wrote the original software. If you use this software in
-* a product, an acknowledgment in the product documentation would be
-* appreciated but is not required.
-*
-* 2. Altered source versions must be plainly marked as such, and must not be
-* misrepresented as being the original software.
-*
-* 3. This notice must not be removed or altered from any source distribution.
-*
-* For using this software for commercial purpose please contact the author.
-*
-*
-*/
-
-package harsh.javatoxml;
-
-import harsh.javatoxml.Exceptions.JXMLException;
-import harsh.javatoxml.data.IXMLElement;
-import harsh.javatoxml.data.XMLElement;
-import harsh.javatoxml.grammar.JavaParser;
-
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.io.StringWriter;
-
-/**
- * This is the main class which provides simple methods to generate the XML representation
- * of the source code.
- *
- * @author Harsh Jain
- * @version 1.0
- */
-public class Java2XML {
-
- public static void main(String[] args) {
- if (args.length < 1){
- System.out.println("Usage: java -jar java2xml.jar file1.java file2.java file3.java .....");
- }else
- {
- try{
- FileReader[] readers = new FileReader[args.length];
-
- for (int i=0;i<readers.length;i++){
- readers[i] = new FileReader(args[i]);
- }
- IXMLElement element = convertToXML(readers, args);
- FileOutputStream fout = new FileOutputStream("output.xml");
- PrintStream pout = new PrintStream(fout);
- System.out.println("Starting parsing");
- XMLHelper.dumpXMLElement(element, pout);
- System.out.println("Written output to output.xml");
- pout.flush();
- fout.flush();
- pout.close();
- fout.close();
- }catch(JXMLException e){
- System.out.println(e.getMessage());
- System.exit(1);
- }catch(FileNotFoundException e){
- System.out.println(e.getMessage());
- System.exit(1);
- }catch(IOException e)
- {
- System.out.println(e.getMessage());
- System.exit(1);
- }
- }
-
-
- }
-
- /**
- * Convert an array of source code files to XML
- *
- *
- * @param javaCode
- * @param classNames
- * @return
- * @throws JXMLException
- */
- public static String java2XML (String[] javaCode, String[] classNames)
- throws JXMLException
- {
- if (javaCode.length != classNames.length)
- throw new JXMLException("Arguments should be of equal length");
- Reader[] readers = new Reader[javaCode.length];
- for (int i = 0;i<javaCode.length;i++){
- readers[i] = new StringReader(javaCode[i]);
- }
- IXMLElement xml = convertToXML(readers, classNames);
- StringWriter writer = new StringWriter();
- XMLHelper.dumpXMLElement(xml, writer);
- return writer.toString();
-
- }
-
- /**
- * Convert one single file to XML
- *
- * @param javaCode
- * @param className
- * @return
- * @throws JXMLException
- */
- public static String java2XML (String javaCode, String className)
- throws JXMLException
- {
- StringReader reader = new StringReader(javaCode);
- IXMLElement xml = convertToXML(reader, className);
- StringWriter writer = new StringWriter();
- XMLHelper.dumpXMLElement(xml, writer);
- return writer.toString();
-
- }
-
-
-
-
- /**
- * Convert an array of Readers with there classNames to XMLElement
- *
- * @param javaCode
- * @param classNames
- * @return
- * @throws JXMLException
- */
- public static IXMLElement convertToXML(Reader[] javaCode, String[] classNames)
- throws JXMLException
- {
- if (javaCode == null || classNames == null || javaCode.length != classNames.length)
- throw new JXMLException("Illegal Arguments passed");
-
- IXMLElement element = new XMLElement();
- element.setName("java-source-program");
- for (int i=0;i<javaCode.length;i++){
- IXMLElement elem = convertToXML(javaCode[i], classNames[i]);
- element.addChild(elem);
- }
- return element;
- }
-
- /**
- *
- * Reads the data from reader and converts it to IXMLElement
- *
- * @param code
- * @param className
- * @return
- * @throws JXMLException
- */
- public static IXMLElement convertToXML(Reader code, String className)
- throws JXMLException
- {
- IXMLElement javaCode = JavaParser.convert(code);
- if (className!=null)
- javaCode.setAttribute("name",className);
- return javaCode;
- }
-
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLHelper.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLHelper.class
deleted file mode 100644
index 3fad967..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLHelper.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLHelper.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLHelper.java
deleted file mode 100644
index 5aab3cf..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLHelper.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-package harsh.javatoxml;
-
-import harsh.javatoxml.Exceptions.JXMLException;
-
-import harsh.javatoxml.data.*;
-
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.Writer;
-
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Vector;
-
-
-/**
- * XML Helper class. This class deals with XML Stuff.
- *
- * @author Harsh Jain
- */
-public class XMLHelper {
-
- /**
- * Dumps the IXMLElement to Output Stream
- *
- * @param element IXMLElement the in memory representation
- * @param out Output stream
- *
- * @throws JXMLException On IOException
- */
- public static void dumpXMLElement(IXMLElement element, PrintStream out)
- throws JXMLException {
- try {
- out.println("<!-- Generated by Java2XML http://java2xml.dev.java.net/ -->");
- out.flush();
-
- XMLWriter writer = new XMLWriter(out);
- writer.write(element, true);
- } catch (IOException e) {
- throw new JXMLException(e.getMessage());
- }
- }
-
- /**
- * Dumps the IXMLElement to the Writer
- *
- * @param element DOCUMENT ME!
- * @param w DOCUMENT ME!
- *
- * @throws JXMLException DOCUMENT ME!
- */
- public static void dumpXMLElement(IXMLElement element, Writer w)
- throws JXMLException {
- try {
- w.write("<!-- Generated by Java2XML http://java2xml.dev.java.net/ -->");
- w.write("\n");
- w.flush();
-
- XMLWriter writer = new XMLWriter(w);
- writer.write(element, true);
- } catch (IOException e) {
- throw new JXMLException(e.getMessage());
- }
- }
-
- /**
- * Create a copy of IXMLElement
- *
- * @param elem
- *
- * @return a new memory copy
- */
- public static IXMLElement createCopy(IXMLElement elem) {
- IXMLElement copy = new XMLElement();
- copy.setName(elem.getName());
-
- Properties p = elem.getAttributes();
- Enumeration allKeys = p.keys();
-
- while (allKeys.hasMoreElements()) {
- String key = (String) allKeys.nextElement();
- copy.setAttribute(key, elem.getAttribute(key));
- }
-
- Vector children = elem.getChildren();
-
- for (int i = 0; i < children.size(); i++) {
- IXMLElement child = (IXMLElement) children.elementAt(i);
- copy.addChild(createCopy(child));
- }
-
- return copy;
- }
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLWriter.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLWriter.class
deleted file mode 100644
index a0d3b0f..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLWriter.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLWriter.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLWriter.java
deleted file mode 100644
index 10e2370..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/XMLWriter.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-package harsh.javatoxml;
-
-import harsh.javatoxml.Exceptions.JXMLException;
-import harsh.javatoxml.data.IXMLElement;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.Writer;
-
-import java.util.Enumeration;
-import java.util.Vector;
-
-
-/**
- * An XMLWriter writes XML data to a stream.
- *
- * @author Harsh Jain
- */
-public class XMLWriter {
- private PrintWriter writer;
-
- /**
- * Creates a new XMLWriter object.
- *
- * @param writer DOCUMENT ME!
- */
- public XMLWriter(Writer writer) {
- if (writer instanceof PrintWriter) {
- this.writer = (PrintWriter) writer;
- } else {
- this.writer = new PrintWriter(writer);
- }
- }
-
- /**
- * Creates a new XMLWriter object.
- *
- * @param stream DOCUMENT ME!
- */
- public XMLWriter(OutputStream stream) {
- this.writer = new PrintWriter(stream);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @throws Throwable DOCUMENT ME!
- */
- protected void finalize() throws Throwable {
- this.writer = null;
- super.finalize();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param xml DOCUMENT ME!
- *
- * @throws JXMLException DOCUMENT ME!
- */
- public void write(IXMLElement xml) throws JXMLException {
- try{
- this.write(xml, false, 0, true);
- }catch(IOException e){
- throw new JXMLException(e.getMessage());
- }
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param xml DOCUMENT ME!
- * @param prettyPrint DOCUMENT ME!
- *
- * @throws JXMLException DOCUMENT ME!
- */
- public void write(IXMLElement xml, boolean prettyPrint)
- throws IOException {
-
- this.write(xml, prettyPrint, 0, true);
-
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param xml DOCUMENT ME!
- * @param prettyPrint DOCUMENT ME!
- * @param indent DOCUMENT ME!
- *
- * @throws IOException DOCUMENT ME!
- */
- public void write(IXMLElement xml, boolean prettyPrint, int indent)
- throws IOException {
- this.write(xml, prettyPrint, indent, true);
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param xml DOCUMENT ME!
- * @param prettyPrint DOCUMENT ME!
- * @param indent DOCUMENT ME!
- * @param collapseEmptyElements DOCUMENT ME!
- *
- * @throws IOException DOCUMENT ME!
- */
- public void write(IXMLElement xml, boolean prettyPrint, int indent, boolean collapseEmptyElements)
- throws IOException {
- if (prettyPrint) {
- for (int i = 0; i < indent; i++) {
- this.writer.print(' ');
- }
- }
-
- if (xml.getName() == null) {
- if (xml.getContent() != null) {
- if (prettyPrint) {
- this.writeEncoded(xml.getContent().trim());
- writer.println();
- } else {
- this.writeEncoded(xml.getContent());
- }
- }
- } else {
- this.writer.print('<');
- this.writer.print(xml.getName());
-
- Vector nsprefixes = new Vector();
-
- Enumeration enumE = xml.enumerateAttributeNames();
-
- while (enumE.hasMoreElements()) {
- String key = (String) enumE.nextElement();
- String value = xml.getAttribute(key, null);
- this.writer.print(" " + key + "=\"");
- this.writeEncoded(value);
- this.writer.print('"');
- }
-
- if ((xml.getContent() != null) && (xml.getContent().length() > 0)) {
- writer.print('>');
- this.writeEncoded(xml.getContent());
- writer.print("</" + xml.getName() + '>');
-
- if (prettyPrint) {
- writer.println();
- }
- } else if (xml.hasChildren() || (!collapseEmptyElements)) {
- writer.print('>');
-
- if (prettyPrint) {
- writer.println();
- }
-
- enumE = xml.enumerateChildren();
-
- while (enumE.hasMoreElements()) {
- IXMLElement child = (IXMLElement) enumE.nextElement();
- this.write(child, prettyPrint, indent + 4, collapseEmptyElements);
- }
-
- if (prettyPrint) {
- for (int i = 0; i < indent; i++) {
- this.writer.print(' ');
- }
- }
-
- this.writer.print("</" + xml.getName() + ">");
-
- if (prettyPrint) {
- writer.println();
- }
- } else {
- this.writer.print("/>");
-
- if (prettyPrint) {
- writer.println();
- }
- }
- }
-
- this.writer.flush();
- }
-
- private void writeEncoded(String str) {
- for (int i = 0; i < str.length(); i++) {
- char c = str.charAt(i);
- this.writer.print(c);
- }
- }
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/IXMLElement.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/IXMLElement.class
deleted file mode 100644
index 19becbc..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/IXMLElement.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/IXMLElement.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/IXMLElement.java
deleted file mode 100644
index ae5670a..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/IXMLElement.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-package harsh.javatoxml.data;
-
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Vector;
-
-
-/**
- * IXMLElement abstracts the tree structure of XML. The interface supports only the basic operations. There is no
- * support for namespaces in elements as well as in attributes, as they are not required.
- *
- * @author Harsh Jain
- */
-public interface IXMLElement {
- /**
- * Returns the name of the element.
- *
- * @return the name, or null if the element only contains #PCDATA.
- */
- public String getName();
-
- /**
- * Sets the full name. This method also sets the short name and clears the namespace URI.
- *
- * @param name the non-null name.
- */
- public void setName(String name);
-
- /**
- * Adds a child element.
- *
- * @param child the non-null child to add.
- */
- public void addChild(IXMLElement child);
-
- /**
- * Removes a child element.
- *
- * @param child the non-null child to remove.
- */
- public void removeChild(IXMLElement child);
-
- /**
- * Removes the child located at a certain index.
- *
- * @param index the index of the child, where the first child has index 0.
- */
- public void removeChildAtIndex(int index);
-
- /**
- * Returns an enumeration of all child elements.
- *
- * @return the non-null enumeration
- */
- public Enumeration enumerateChildren();
-
- /**
- * Returns whether the element is a leaf element.
- *
- * @return true if the element has no children.
- */
- public boolean isLeaf();
-
- /**
- * Returns whether the element has children.
- *
- * @return true if the element has children.
- */
- public boolean hasChildren();
-
- /**
- * Returns the number of children.
- *
- * @return the count.
- */
- public int getChildrenCount();
-
- /**
- * Returns a vector containing all the child elements.
- *
- * @return the vector.
- */
- public Vector getChildren();
-
- /**
- * Returns the child at a specific index.
- *
- * @param index the index of the child
- *
- * @return the non-null child
- *
- * @throws ArrayIndexOutOfBoundsException if the index is out of bounds.
- */
- public IXMLElement getChildAtIndex(int index) throws ArrayIndexOutOfBoundsException;
-
- /**
- * Searches a child element.
- *
- * @param name the full name of the child to search for.
- *
- * @return the child element, or null if no such child was found.
- */
- public IXMLElement getFirstChildNamed(String name);
-
- /**
- * Returns a vector of all child elements named <I>name</I>.
- *
- * @param name the full name of the children to search for.
- *
- * @return the non-null vector of child elements.
- */
- public Vector getChildrenNamed(String name);
-
- /**
- * Returns the number of attributes.
- *
- * @return number of attributes
- */
- public int getAttributeCount();
-
- /**
- * Returns the value of an attribute.
- *
- * @param name the non-null name of the attribute.
- *
- * @return the value, or null if the attribute does not exist.
- */
- public String getAttribute(String name);
-
- /**
- * Returns the value of an attribute.
- *
- * @param name the non-null full name of the attribute.
- * @param defaultValue the default value of the attribute.
- *
- * @return the value, or defaultValue if the attribute does not exist.
- */
- public String getAttribute(String name, String defaultValue);
-
- /**
- * Sets an attribute.
- *
- * @param name the non-null full name of the attribute.
- * @param value the non-null value of the attribute.
- */
- public void setAttribute(String name, String value);
-
- /**
- * Removes an attribute.
- *
- * @param name the non-null name of the attribute.
- */
- public void removeAttribute(String name);
-
- /**
- * Returns an enumeration of all attribute names.
- *
- * @return the non-null enumeration.
- */
- public Enumeration enumerateAttributeNames();
-
- /**
- * Returns whether an attribute exists.
- *
- * @param name the non-null name of the attribute.
- *
- * @return true if the attribute exists.
- */
- public boolean hasAttribute(String name);
-
- /**
- * Returns all attributes as a Properties object.
- *
- * @return the non-null set.
- */
- public Properties getAttributes();
-
- /**
- * Return the #PCDATA content of the element.
- *
- * @return the content.
- */
- public String getContent();
-
- /**
- * Sets the #PCDATA content.
- *
- * @param content the (possibly null) content.
- */
- public void setContent(String content);
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement$1.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement$1.class
deleted file mode 100644
index aa93708..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement$1.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement$Attribute.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement$Attribute.class
deleted file mode 100644
index ba4bb0f..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement$Attribute.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.class
deleted file mode 100644
index 4aef79b..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.java
deleted file mode 100644
index 7aac55d..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-package harsh.javatoxml.data;
-
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Vector;
-
-
-/**
- * XMLElement is the standard implementation of IXMLElement.
- *
- * @author Harsh Jain
- * @version 1.0
- */
-public class XMLElement implements IXMLElement {
- /** The parent element. */
- private IXMLElement parent;
-
- /** The attributes of the element. */
- private Vector attributes;
-
- /** The child elements. */
- private Vector children;
-
- /** The name of the element. */
- private String name;
-
- /** The content of the element. */
- private String content;
-
- /**
- * Creates an empty element.
- */
- public XMLElement() {
- this.attributes = new Vector();
- this.children = new Vector(8);
- this.content = null;
- this.parent = null;
- }
-
- /**
- * Cleans up the object when it's destroyed.
- *
- * @throws Throwable DOCUMENT ME!
- */
- protected void finalize() throws Throwable {
- this.attributes.clear();
- this.attributes = null;
- this.children = null;
- this.name = null;
- this.content = null;
- this.parent = null;
- super.finalize();
- }
-
- /**
- * Returns the parent element. This method returns null for the root element.
- *
- * @return Parent element
- */
- public IXMLElement getParent() {
- return this.parent;
- }
-
- /**
- * Returns the name of the element.
- *
- * @return the name, or null if the element only contains #PCDATA.
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Sets the name
- *
- * @param name the non-null name.
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Adds a child element.
- *
- * @param child the non-null child to add.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public void addChild(IXMLElement child) {
- if (child == null) {
- throw new IllegalArgumentException("child must not be null");
- }
-
- if ((child.getName() == null) && (!this.children.isEmpty())) {
- IXMLElement lastChild = (IXMLElement) this.children.lastElement();
-
- if (lastChild.getName() == null) {
- lastChild.setContent(lastChild.getContent() + child.getContent());
-
- return;
- }
- }
-
- ((XMLElement) child).parent = this;
- this.children.addElement(child);
- }
-
- /**
- * Inserts a child element.
- *
- * @param child the non-null child to add.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- /**
- * Removes a child element.
- *
- * @param child the non-null child to remove.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public void removeChild(IXMLElement child) {
- if (child == null) {
- throw new IllegalArgumentException("child must not be null");
- }
-
- this.children.removeElement(child);
- }
-
- /**
- * Removes the child located at a certain index.
- *
- * @param index the index of the child, where the first child has index 0.
- */
- public void removeChildAtIndex(int index) {
- this.children.removeElementAt(index);
- }
-
- /**
- * Returns an enumeration of all child elements.
- *
- * @return the non-null enumeration
- */
- public Enumeration enumerateChildren() {
- return this.children.elements();
- }
-
- /**
- * Returns whether the element is a leaf element.
- *
- * @return true if the element has no children.
- */
- public boolean isLeaf() {
- return this.children.isEmpty();
- }
-
- /**
- * Returns whether the element has children.
- *
- * @return true if the element has children.
- */
- public boolean hasChildren() {
- return (!this.children.isEmpty());
- }
-
- /**
- * Returns the number of children.
- *
- * @return the count.
- */
- public int getChildrenCount() {
- return this.children.size();
- }
-
- /**
- * Returns a vector containing all the child elements.
- *
- * @return the vector.
- */
- public Vector getChildren() {
- return this.children;
- }
-
- /**
- * Returns the child at a specific index.
- *
- * @param index the index of the child
- *
- * @return the non-null child
- *
- * @throws ArrayIndexOutOfBoundsException if the index is out of bounds.
- */
- public IXMLElement getChildAtIndex(int index) throws ArrayIndexOutOfBoundsException {
- return (IXMLElement) this.children.elementAt(index);
- }
-
- /**
- * Searches a child element.
- *
- * @param name the full name of the child to search for.
- *
- * @return the child element, or null if no such child was found.
- */
- public IXMLElement getFirstChildNamed(String name) {
- Enumeration enumE = this.children.elements();
-
- while (enumE.hasMoreElements()) {
- IXMLElement child = (IXMLElement) enumE.nextElement();
- String childName = child.getName();
-
- if ((childName != null) && childName.equals(name)) {
- return child;
- }
- }
-
- return null;
- }
-
- /**
- * Returns a vector of all child elements named <I>name</I>.
- *
- * @param name the full name of the children to search for.
- *
- * @return the non-null vector of child elements.
- */
- public Vector getChildrenNamed(String name) {
- Vector result = new Vector(this.children.size());
- Enumeration enumE = this.children.elements();
-
- while (enumE.hasMoreElements()) {
- IXMLElement child = (IXMLElement) enumE.nextElement();
- String childName = child.getName();
-
- if ((childName != null) && childName.equals(name)) {
- result.addElement(child);
- }
- }
-
- return result;
- }
-
- /**
- * Returns the number of attributes.
- *
- * @return DOCUMENT ME!
- */
- public int getAttributeCount() {
- return this.attributes.size();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param name the non-null name of the attribute.
- *
- * @return the value, or null if the attribute does not exist.
- *
- * @deprecated As of NanoXML/Java 2.1, replaced by {@link #getAttribute(java.lang.String,java.lang.String)} Returns
- * the value of an attribute.
- */
- public String getAttribute(String name) {
- return this.getAttribute(name, null);
- }
-
- /**
- * Returns the value of an attribute.
- *
- * @param name the non-null full name of the attribute.
- * @param defaultValue the default value of the attribute.
- *
- * @return the value, or defaultValue if the attribute does not exist.
- */
- public String getAttribute(String name, String defaultValue) {
- Attribute attr = searchAttribute(name);
-
- if (attr == null) {
- return defaultValue;
- } else {
- return attr.value;
- }
- }
-
- private Attribute searchAttribute(String name) {
- for (int i = 0; i < attributes.size(); i++) {
- Attribute at = (Attribute) attributes.elementAt(i);
-
- if (at.key.equals(name)) {
- return at;
- }
- }
-
- return null;
- }
-
- /**
- * Sets an attribute.
- *
- * @param name the non-null full name of the attribute.
- * @param value the non-null value of the attribute.
- */
- public void setAttribute(String name, String value) {
- Attribute attr = searchAttribute(name);
-
- if (attr == null) {
- attr = new Attribute();
- attr.key = name;
- attr.value = value;
- attributes.addElement(attr);
- } else {
- attr.value = value;
- }
- }
-
- /**
- * Removes an attribute.
- *
- * @param name the non-null name of the attribute.
- */
- public void removeAttribute(String name) {
- for (int i = 0; i < this.attributes.size(); i++) {
- Attribute attr = (Attribute) this.attributes.elementAt(i);
-
- if (attr.key.equals(name)) {
- this.attributes.removeElementAt(i);
-
- return;
- }
- }
- }
-
- /**
- * Returns an enumeration of all attribute names.
- *
- * @return the non-null enumeration.
- */
- public Enumeration enumerateAttributeNames() {
- Vector result = new Vector();
- Enumeration enumE = this.attributes.elements();
-
- while (enumE.hasMoreElements()) {
- Attribute attr = (Attribute) enumE.nextElement();
- result.addElement(attr.key);
- }
-
- return result.elements();
- }
-
- /**
- * Returns whether an attribute exists.
- *
- * @param name DOCUMENT ME!
- *
- * @return true if the attribute exists.
- */
- public boolean hasAttribute(String name) {
- return searchAttribute(name) != null;
- }
-
- /**
- * Returns all attributes as a Properties object.
- *
- * @return the non-null set.
- */
- public Properties getAttributes() {
- Properties result = new Properties();
- Enumeration enumE = this.attributes.elements();
-
- while (enumE.hasMoreElements()) {
- Attribute attr = (Attribute) enumE.nextElement();
- result.put(attr.key, attr.value);
- }
-
- return result;
- }
-
- /**
- * Returns all attributes in a specific namespace as a Properties object.
- *
- * @return the non-null set.
- */
- /**
- * Return the #PCDATA content of the element. If the element has a combination of #PCDATA content and child
- * elements, the #PCDATA sections can be retrieved as unnamed child objects. In this case, this method returns
- * null.
- *
- * @return the content.
- */
- public String getContent() {
- return this.content;
- }
-
- /**
- * Sets the #PCDATA content. It is an error to call this method with a non-null value if there are child objects.
- *
- * @param content the (possibly null) content.
- */
- public void setContent(String content) {
- this.content = content;
- }
-
- private class Attribute {
- public String key;
- public String value;
- }
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.old b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.old
deleted file mode 100644
index 9d97c42..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/data/XMLElement.old
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-package harsh.javatoxml.data;
-
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Vector;
-
-
-/**
- * XMLElement is the standard implementation of IXMLElement.
- *
- * @author Harsh Jain
- * @version 1.0
- */
-public class XMLElement implements IXMLElement {
- /** The parent element. */
- private IXMLElement parent;
-
- /** The attributes of the element. */
- private Vector attributes;
-
- /** The child elements. */
- private Vector children;
-
- /** The name of the element. */
- private String name;
-
- /** The content of the element. */
- private String content;
-
- /**
- * Creates an empty element.
- */
- public XMLElement() {
- this.attributes = new Vector();
- this.children = new Vector(8);
- this.content = null;
- this.parent = null;
- }
-
- /**
- * Cleans up the object when it's destroyed.
- *
- * @throws Throwable DOCUMENT ME!
- */
- protected void finalize() throws Throwable {
- this.attributes.clear();
- this.attributes = null;
- this.children = null;
- this.name = null;
- this.content = null;
- this.parent = null;
- super.finalize();
- }
-
- /**
- * Returns the parent element. This method returns null for the root element.
- *
- * @return Parent element
- */
- public IXMLElement getParent() {
- return this.parent;
- }
-
- /**
- * Returns the name of the element.
- *
- * @return the name, or null if the element only contains #PCDATA.
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Sets the name
- *
- * @param name the non-null name.
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Adds a child element.
- *
- * @param child the non-null child to add.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public void addChild(IXMLElement child) {
- if (child == null) {
- throw new IllegalArgumentException("child must not be null");
- }
-
- if ((child.getName() == null) && (!this.children.isEmpty())) {
- IXMLElement lastChild = (IXMLElement) this.children.lastElement();
-
- if (lastChild.getName() == null) {
- lastChild.setContent(lastChild.getContent() + child.getContent());
-
- return;
- }
- }
-
- ((XMLElement) child).parent = this;
- this.children.addElement(child);
- }
-
- /**
- * Inserts a child element.
- *
- * @param child the non-null child to add.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- /**
- * Removes a child element.
- *
- * @param child the non-null child to remove.
- *
- * @throws IllegalArgumentException DOCUMENT ME!
- */
- public void removeChild(IXMLElement child) {
- if (child == null) {
- throw new IllegalArgumentException("child must not be null");
- }
-
- this.children.removeElement(child);
- }
-
- /**
- * Removes the child located at a certain index.
- *
- * @param index the index of the child, where the first child has index 0.
- */
- public void removeChildAtIndex(int index) {
- this.children.removeElementAt(index);
- }
-
- /**
- * Returns an enumeration of all child elements.
- *
- * @return the non-null enumeration
- */
- public Enumeration enumerateChildren() {
- return this.children.elements();
- }
-
- /**
- * Returns whether the element is a leaf element.
- *
- * @return true if the element has no children.
- */
- public boolean isLeaf() {
- return this.children.isEmpty();
- }
-
- /**
- * Returns whether the element has children.
- *
- * @return true if the element has children.
- */
- public boolean hasChildren() {
- return (!this.children.isEmpty());
- }
-
- /**
- * Returns the number of children.
- *
- * @return the count.
- */
- public int getChildrenCount() {
- return this.children.size();
- }
-
- /**
- * Returns a vector containing all the child elements.
- *
- * @return the vector.
- */
- public Vector getChildren() {
- return this.children;
- }
-
- /**
- * Returns the child at a specific index.
- *
- * @param index the index of the child
- *
- * @return the non-null child
- *
- * @throws ArrayIndexOutOfBoundsException if the index is out of bounds.
- */
- public IXMLElement getChildAtIndex(int index) throws ArrayIndexOutOfBoundsException {
- return (IXMLElement) this.children.elementAt(index);
- }
-
- /**
- * Searches a child element.
- *
- * @param name the full name of the child to search for.
- *
- * @return the child element, or null if no such child was found.
- */
- public IXMLElement getFirstChildNamed(String name) {
- Enumeration enum = this.children.elements();
-
- while (enum.hasMoreElements()) {
- IXMLElement child = (IXMLElement) enum.nextElement();
- String childName = child.getName();
-
- if ((childName != null) && childName.equals(name)) {
- return child;
- }
- }
-
- return null;
- }
-
- /**
- * Returns a vector of all child elements named <I>name</I>.
- *
- * @param name the full name of the children to search for.
- *
- * @return the non-null vector of child elements.
- */
- public Vector getChildrenNamed(String name) {
- Vector result = new Vector(this.children.size());
- Enumeration enum = this.children.elements();
-
- while (enum.hasMoreElements()) {
- IXMLElement child = (IXMLElement) enum.nextElement();
- String childName = child.getName();
-
- if ((childName != null) && childName.equals(name)) {
- result.addElement(child);
- }
- }
-
- return result;
- }
-
- /**
- * Returns the number of attributes.
- *
- * @return DOCUMENT ME!
- */
- public int getAttributeCount() {
- return this.attributes.size();
- }
-
- /**
- * DOCUMENT ME!
- *
- * @param name the non-null name of the attribute.
- *
- * @return the value, or null if the attribute does not exist.
- *
- * @deprecated As of NanoXML/Java 2.1, replaced by {@link #getAttribute(java.lang.String,java.lang.String)} Returns
- * the value of an attribute.
- */
- public String getAttribute(String name) {
- return this.getAttribute(name, null);
- }
-
- /**
- * Returns the value of an attribute.
- *
- * @param name the non-null full name of the attribute.
- * @param defaultValue the default value of the attribute.
- *
- * @return the value, or defaultValue if the attribute does not exist.
- */
- public String getAttribute(String name, String defaultValue) {
- Attribute attr = searchAttribute(name);
-
- if (attr == null) {
- return defaultValue;
- } else {
- return attr.value;
- }
- }
-
- private Attribute searchAttribute(String name) {
- for (int i = 0; i < attributes.size(); i++) {
- Attribute at = (Attribute) attributes.elementAt(i);
-
- if (at.key.equals(name)) {
- return at;
- }
- }
-
- return null;
- }
-
- /**
- * Sets an attribute.
- *
- * @param name the non-null full name of the attribute.
- * @param value the non-null value of the attribute.
- */
- public void setAttribute(String name, String value) {
- Attribute attr = searchAttribute(name);
-
- if (attr == null) {
- attr = new Attribute();
- attr.key = name;
- attr.value = value;
- attributes.addElement(attr);
- } else {
- attr.value = value;
- }
- }
-
- /**
- * Removes an attribute.
- *
- * @param name the non-null name of the attribute.
- */
- public void removeAttribute(String name) {
- for (int i = 0; i < this.attributes.size(); i++) {
- Attribute attr = (Attribute) this.attributes.elementAt(i);
-
- if (attr.key.equals(name)) {
- this.attributes.removeElementAt(i);
-
- return;
- }
- }
- }
-
- /**
- * Returns an enumeration of all attribute names.
- *
- * @return the non-null enumeration.
- */
- public Enumeration enumerateAttributeNames() {
- Vector result = new Vector();
- Enumeration enum = this.attributes.elements();
-
- while (enum.hasMoreElements()) {
- Attribute attr = (Attribute) enum.nextElement();
- result.addElement(attr.key);
- }
-
- return result.elements();
- }
-
- /**
- * Returns whether an attribute exists.
- *
- * @param name DOCUMENT ME!
- *
- * @return true if the attribute exists.
- */
- public boolean hasAttribute(String name) {
- return searchAttribute(name) != null;
- }
-
- /**
- * Returns all attributes as a Properties object.
- *
- * @return the non-null set.
- */
- public Properties getAttributes() {
- Properties result = new Properties();
- Enumeration enum = this.attributes.elements();
-
- while (enum.hasMoreElements()) {
- Attribute attr = (Attribute) enum.nextElement();
- result.put(attr.key, attr.value);
- }
-
- return result;
- }
-
- /**
- * Returns all attributes in a specific namespace as a Properties object.
- *
- * @return the non-null set.
- */
- /**
- * Return the #PCDATA content of the element. If the element has a combination of #PCDATA content and child
- * elements, the #PCDATA sections can be retrieved as unnamed child objects. In this case, this method returns
- * null.
- *
- * @return the content.
- */
- public String getContent() {
- return this.content;
- }
-
- /**
- * Sets the #PCDATA content. It is an error to call this method with a non-null value if there are child objects.
- *
- * @param content the (possibly null) content.
- */
- public void setContent(String content) {
- this.content = content;
- }
-
- private class Attribute {
- public String key;
- public String value;
- }
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/.JavaParser.java.swp b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/.JavaParser.java.swp
deleted file mode 100644
index bd186f0..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/.JavaParser.java.swp and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/.JavaParser.jj.swp b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/.JavaParser.jj.swp
deleted file mode 100644
index c5139fe..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/.JavaParser.jj.swp and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/AGarder/MyToken.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/AGarder/MyToken.java
deleted file mode 100644
index 6a3e3aa..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/AGarder/MyToken.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package harsh.javatoxml.grammar;
-
-public class MyToken extends Token
-{
- /**
- * Constructs a new token for the specified Image and Kind.
- */
- public MyToken(int kind, String image)
- {
- this.kind = kind;
- this.image = image;
- }
-
- int realKind = JavaParserConstants.GT;
-
- /**
- * Returns a new Token object.
- */
-
- public static final Token newToken(int ofKind, String tokenImage)
- {
- return new MyToken(ofKind, tokenImage);
- }
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/AGarder/Token.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/AGarder/Token.java
deleted file mode 100644
index 75ce72d..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/AGarder/Token.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
-/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-
-/**
- * Describes the input token stream.
- */
-
-public class Token implements java.io.Serializable {
-
- /**
- * The version identifier for this Serializable class.
- * Increment only if the <i>serialized</i> form of the
- * class changes.
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * An integer that describes the kind of this token. This numbering
- * system is determined by JavaCCParser, and a table of these numbers is
- * stored in the file ...Constants.java.
- */
- public int kind;
-
- /** The line number of the first character of this Token. */
- public int beginLine;
- /** The column number of the first character of this Token. */
- public int beginColumn;
- /** The line number of the last character of this Token. */
- public int endLine;
- /** The column number of the last character of this Token. */
- public int endColumn;
-
- /**
- * The string image of the token.
- */
- public String image;
-
- /**
- * A reference to the next regular (non-special) token from the input
- * stream. If this is the last token from the input stream, or if the
- * token manager has not read tokens beyond this one, this field is
- * set to null. This is true only if this token is also a regular
- * token. Otherwise, see below for a description of the contents of
- * this field.
- */
- public Token next;
-
- /**
- * This field is used to access special tokens that occur prior to this
- * token, but after the immediately preceding regular (non-special) token.
- * If there are no such special tokens, this field is set to null.
- * When there are more than one such special token, this field refers
- * to the last of these special tokens, which in turn refers to the next
- * previous special token through its specialToken field, and so on
- * until the first special token (whose specialToken field is null).
- * The next fields of special tokens refer to other special tokens that
- * immediately follow it (without an intervening regular token). If there
- * is no such token, this field is null.
- */
- public Token specialToken;
-
- /**
- * An optional attribute value of the Token.
- * Tokens which are not used as syntactic sugar will often contain
- * meaningful values that will be used later on by the compiler or
- * interpreter. This attribute value is often different from the image.
- * Any subclass of Token that actually wants to return a non-null value can
- * override this method as appropriate.
- */
- public Object getValue() {
- return null;
- }
-
- /**
- * No-argument constructor
- */
- public Token() {}
-
- /**
- * Constructs a new token for the specified Image.
- */
- public Token(int kind)
- {
- this(kind, null);
- }
-
- /**
- * Constructs a new token for the specified Image and Kind.
- */
- public Token(int kind, String image)
- {
- this.kind = kind;
- this.image = image;
- }
-
- /**
- * Returns the image.
- */
- public String toString()
- {
- return image;
- }
-
- /**
- * Returns a new Token object, by default. However, if you want, you
- * can create and return subclass objects based on the value of ofKind.
- * Simply add the cases to the switch for all those special cases.
- * For example, if you have a subclass of Token called IDToken that
- * you want to create if ofKind is ID, simply add something like :
- *
- * case MyParserConstants.ID : return new IDToken(ofKind, image);
- *
- * to the following switch statement. Then you can cast matchedToken
- * variable to the appropriate type and use sit in your lexical actions.
- */
- public static Token newToken(int ofKind, String image)
- {
- switch(ofKind)
- {
- default : return new Token(ofKind, image);
- /* case JavaCCParserConstants.RUNSIGNEDSHIFT:
- case JavaCCParserConstants.RSIGNEDSHIFT:
- case JavaCCParserConstants.GT: return new GTToken();*/
-
-
- }
- }
-
- public static Token newToken(int ofKind)
- {
- return newToken(ofKind, null);
- }
-
- public static class GTToken extends Token
- {
- public GTToken(int kind, String image)
- {
- super(kind, image);
- }
-
- int realKind = JavaParserConstants.GT;
- }
-
-
-}
-/* JavaCC - OriginalChecksum=89f2396d3378f6abe73e80eb943bb6d0 (do not edit this line) */
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaCharStream.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaCharStream.class
deleted file mode 100644
index 1847f5b..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaCharStream.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaCharStream.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaCharStream.java
deleted file mode 100644
index 21c8f13..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaCharStream.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 5.0 */
-/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-
-/**
- * An implementation of interface CharStream, where the stream is assumed to
- * contain only ASCII characters (with java-like unicode escape processing).
- */
-
-public
-class JavaCharStream
-{
- /** Whether parser is static. */
- public static final boolean staticFlag = false;
-
- static final int hexval(char c) throws java.io.IOException {
- switch(c)
- {
- case '0' :
- return 0;
- case '1' :
- return 1;
- case '2' :
- return 2;
- case '3' :
- return 3;
- case '4' :
- return 4;
- case '5' :
- return 5;
- case '6' :
- return 6;
- case '7' :
- return 7;
- case '8' :
- return 8;
- case '9' :
- return 9;
-
- case 'a' :
- case 'A' :
- return 10;
- case 'b' :
- case 'B' :
- return 11;
- case 'c' :
- case 'C' :
- return 12;
- case 'd' :
- case 'D' :
- return 13;
- case 'e' :
- case 'E' :
- return 14;
- case 'f' :
- case 'F' :
- return 15;
- }
-
- throw new java.io.IOException(); // Should never come here
- }
-
-/** Position in buffer. */
- public int bufpos = -1;
- int bufsize;
- int available;
- int tokenBegin;
- protected int bufline[];
- protected int bufcolumn[];
-
- protected int column = 0;
- protected int line = 1;
-
- protected boolean prevCharIsCR = false;
- protected boolean prevCharIsLF = false;
-
- protected java.io.Reader inputStream;
-
- protected char[] nextCharBuf;
- protected char[] buffer;
- protected int maxNextCharInd = 0;
- protected int nextCharInd = -1;
- protected int inBuf = 0;
- protected int tabSize = 8;
-
- protected void setTabSize(int i) { tabSize = i; }
- protected int getTabSize(int i) { return tabSize; }
-
- protected void ExpandBuff(boolean wrapAround)
- {
- char[] newbuffer = new char[bufsize + 2048];
- int newbufline[] = new int[bufsize + 2048];
- int newbufcolumn[] = new int[bufsize + 2048];
-
- try
- {
- if (wrapAround)
- {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
- buffer = newbuffer;
-
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
- bufline = newbufline;
-
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
- System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
- bufcolumn = newbufcolumn;
-
- bufpos += (bufsize - tokenBegin);
- }
- else
- {
- System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
- buffer = newbuffer;
-
- System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
- bufline = newbufline;
-
- System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
- bufcolumn = newbufcolumn;
-
- bufpos -= tokenBegin;
- }
- }
- catch (Throwable t)
- {
- throw new Error(t.getMessage());
- }
-
- available = (bufsize += 2048);
- tokenBegin = 0;
- }
-
- protected void FillBuff() throws java.io.IOException
- {
- int i;
- if (maxNextCharInd == 4096)
- maxNextCharInd = nextCharInd = 0;
-
- try {
- if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
- 4096 - maxNextCharInd)) == -1)
- {
- inputStream.close();
- throw new java.io.IOException();
- }
- else
- maxNextCharInd += i;
- return;
- }
- catch(java.io.IOException e) {
- if (bufpos != 0)
- {
- --bufpos;
- backup(0);
- }
- else
- {
- bufline[bufpos] = line;
- bufcolumn[bufpos] = column;
- }
- throw e;
- }
- }
-
- protected char ReadByte() throws java.io.IOException
- {
- if (++nextCharInd >= maxNextCharInd)
- FillBuff();
-
- return nextCharBuf[nextCharInd];
- }
-
-/** @return starting character for token. */
- public char BeginToken() throws java.io.IOException
- {
- if (inBuf > 0)
- {
- --inBuf;
-
- if (++bufpos == bufsize)
- bufpos = 0;
-
- tokenBegin = bufpos;
- return buffer[bufpos];
- }
-
- tokenBegin = 0;
- bufpos = -1;
-
- return readChar();
- }
-
- protected void AdjustBuffSize()
- {
- if (available == bufsize)
- {
- if (tokenBegin > 2048)
- {
- bufpos = 0;
- available = tokenBegin;
- }
- else
- ExpandBuff(false);
- }
- else if (available > tokenBegin)
- available = bufsize;
- else if ((tokenBegin - available) < 2048)
- ExpandBuff(true);
- else
- available = tokenBegin;
- }
-
- protected void UpdateLineColumn(char c)
- {
- column++;
-
- if (prevCharIsLF)
- {
- prevCharIsLF = false;
- line += (column = 1);
- }
- else if (prevCharIsCR)
- {
- prevCharIsCR = false;
- if (c == '\n')
- {
- prevCharIsLF = true;
- }
- else
- line += (column = 1);
- }
-
- switch (c)
- {
- case '\r' :
- prevCharIsCR = true;
- break;
- case '\n' :
- prevCharIsLF = true;
- break;
- case '\t' :
- column--;
- column += (tabSize - (column % tabSize));
- break;
- default :
- break;
- }
-
- bufline[bufpos] = line;
- bufcolumn[bufpos] = column;
- }
-
-/** Read a character. */
- public char readChar() throws java.io.IOException
- {
- if (inBuf > 0)
- {
- --inBuf;
-
- if (++bufpos == bufsize)
- bufpos = 0;
-
- return buffer[bufpos];
- }
-
- char c;
-
- if (++bufpos == available)
- AdjustBuffSize();
-
- if ((buffer[bufpos] = c = ReadByte()) == '\\')
- {
- UpdateLineColumn(c);
-
- int backSlashCnt = 1;
-
- for (;;) // Read all the backslashes
- {
- if (++bufpos == available)
- AdjustBuffSize();
-
- try
- {
- if ((buffer[bufpos] = c = ReadByte()) != '\\')
- {
- UpdateLineColumn(c);
- // found a non-backslash char.
- if ((c == 'u') && ((backSlashCnt & 1) == 1))
- {
- if (--bufpos < 0)
- bufpos = bufsize - 1;
-
- break;
- }
-
- backup(backSlashCnt);
- return '\\';
- }
- }
- catch(java.io.IOException e)
- {
- // We are returning one backslash so we should only backup (count-1)
- if (backSlashCnt > 1)
- backup(backSlashCnt-1);
-
- return '\\';
- }
-
- UpdateLineColumn(c);
- backSlashCnt++;
- }
-
- // Here, we have seen an odd number of backslash's followed by a 'u'
- try
- {
- while ((c = ReadByte()) == 'u')
- ++column;
-
- buffer[bufpos] = c = (char)(hexval(c) << 12 |
- hexval(ReadByte()) << 8 |
- hexval(ReadByte()) << 4 |
- hexval(ReadByte()));
-
- column += 4;
- }
- catch(java.io.IOException e)
- {
- throw new Error("Invalid escape character at line " + line +
- " column " + column + ".");
- }
-
- if (backSlashCnt == 1)
- return c;
- else
- {
- backup(backSlashCnt - 1);
- return '\\';
- }
- }
- else
- {
- UpdateLineColumn(c);
- return c;
- }
- }
-
- @Deprecated
- /**
- * @deprecated
- * @see #getEndColumn
- */
- public int getColumn() {
- return bufcolumn[bufpos];
- }
-
- @Deprecated
- /**
- * @deprecated
- * @see #getEndLine
- */
- public int getLine() {
- return bufline[bufpos];
- }
-
-/** Get end column. */
- public int getEndColumn() {
- return bufcolumn[bufpos];
- }
-
-/** Get end line. */
- public int getEndLine() {
- return bufline[bufpos];
- }
-
-/** @return column of token start */
- public int getBeginColumn() {
- return bufcolumn[tokenBegin];
- }
-
-/** @return line number of token start */
- public int getBeginLine() {
- return bufline[tokenBegin];
- }
-
-/** Retreat. */
- public void backup(int amount) {
-
- inBuf += amount;
- if ((bufpos -= amount) < 0)
- bufpos += bufsize;
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.Reader dstream,
- int startline, int startcolumn, int buffersize)
- {
- inputStream = dstream;
- line = startline;
- column = startcolumn - 1;
-
- available = bufsize = buffersize;
- buffer = new char[buffersize];
- bufline = new int[buffersize];
- bufcolumn = new int[buffersize];
- nextCharBuf = new char[4096];
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.Reader dstream,
- int startline, int startcolumn)
- {
- this(dstream, startline, startcolumn, 4096);
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.Reader dstream)
- {
- this(dstream, 1, 1, 4096);
- }
-/** Reinitialise. */
- public void ReInit(java.io.Reader dstream,
- int startline, int startcolumn, int buffersize)
- {
- inputStream = dstream;
- line = startline;
- column = startcolumn - 1;
-
- if (buffer == null || buffersize != buffer.length)
- {
- available = bufsize = buffersize;
- buffer = new char[buffersize];
- bufline = new int[buffersize];
- bufcolumn = new int[buffersize];
- nextCharBuf = new char[4096];
- }
- prevCharIsLF = prevCharIsCR = false;
- tokenBegin = inBuf = maxNextCharInd = 0;
- nextCharInd = bufpos = -1;
- }
-
-/** Reinitialise. */
- public void ReInit(java.io.Reader dstream,
- int startline, int startcolumn)
- {
- ReInit(dstream, startline, startcolumn, 4096);
- }
-
-/** Reinitialise. */
- public void ReInit(java.io.Reader dstream)
- {
- ReInit(dstream, 1, 1, 4096);
- }
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
- {
- this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, int startline,
- int startcolumn, int buffersize)
- {
- this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn) throws java.io.UnsupportedEncodingException
- {
- this(dstream, encoding, startline, startcolumn, 4096);
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, int startline,
- int startcolumn)
- {
- this(dstream, startline, startcolumn, 4096);
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
- {
- this(dstream, encoding, 1, 1, 4096);
- }
-
-/** Constructor. */
- public JavaCharStream(java.io.InputStream dstream)
- {
- this(dstream, 1, 1, 4096);
- }
-
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
- {
- ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
- }
-
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, int startline,
- int startcolumn, int buffersize)
- {
- ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
- }
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, String encoding, int startline,
- int startcolumn) throws java.io.UnsupportedEncodingException
- {
- ReInit(dstream, encoding, startline, startcolumn, 4096);
- }
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, int startline,
- int startcolumn)
- {
- ReInit(dstream, startline, startcolumn, 4096);
- }
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
- {
- ReInit(dstream, encoding, 1, 1, 4096);
- }
-
-/** Reinitialise. */
- public void ReInit(java.io.InputStream dstream)
- {
- ReInit(dstream, 1, 1, 4096);
- }
-
- /** @return token image as String */
- public String GetImage()
- {
- if (bufpos >= tokenBegin)
- return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
- else
- return new String(buffer, tokenBegin, bufsize - tokenBegin) +
- new String(buffer, 0, bufpos + 1);
- }
-
- /** @return suffix */
- public char[] GetSuffix(int len)
- {
- char[] ret = new char[len];
-
- if ((bufpos + 1) >= len)
- System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
- else
- {
- System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
- len - bufpos - 1);
- System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
- }
-
- return ret;
- }
-
- /** Set buffers back to null when finished. */
- public void Done()
- {
- nextCharBuf = null;
- buffer = null;
- bufline = null;
- bufcolumn = null;
- }
-
- /**
- * Method to adjust line and column numbers for the start of a token.
- */
- public void adjustBeginLineColumn(int newLine, int newCol)
- {
- int start = tokenBegin;
- int len;
-
- if (bufpos >= tokenBegin)
- {
- len = bufpos - tokenBegin + inBuf + 1;
- }
- else
- {
- len = bufsize - tokenBegin + bufpos + 1 + inBuf;
- }
-
- int i = 0, j = 0, k = 0;
- int nextColDiff = 0, columnDiff = 0;
-
- while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
- {
- bufline[j] = newLine;
- nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
- bufcolumn[j] = newCol + columnDiff;
- columnDiff = nextColDiff;
- i++;
- }
-
- if (i < len)
- {
- bufline[j] = newLine++;
- bufcolumn[j] = newCol + columnDiff;
-
- while (i++ < len)
- {
- if (bufline[j = start % bufsize] != bufline[++start % bufsize])
- bufline[j] = newLine++;
- else
- bufline[j] = newLine;
- }
- }
-
- line = bufline[j];
- column = bufcolumn[j];
- }
-
-}
-/* JavaCC - OriginalChecksum=f1afc629c19b71f28313e1d2245fcb87 (do not edit this line) */
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$1.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$1.class
deleted file mode 100644
index 2730c52..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$1.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$LookaheadSuccess.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$LookaheadSuccess.class
deleted file mode 100644
index 4d91c83..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$LookaheadSuccess.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$ModifierSet.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$ModifierSet.class
deleted file mode 100644
index d83887b..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser$ModifierSet.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.class
deleted file mode 100644
index 589b4a2..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.java
deleted file mode 100644
index 73bc26b..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.java
+++ /dev/null
@@ -1,7485 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. JavaParser.java */
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-import harsh.javatoxml.XMLHelper;
-import harsh.javatoxml.Exceptions.*;
-
-import java.io.*;
-import java.util.LinkedList;
-import java.util.Iterator;
-
-
-
-
-
-import harsh.javatoxml.data.*;
-
-/**
- * Grammar to parse Java version 1.5
- * @author Sreenivasa Viswanadha - Simplified and enhanced for 1.5
- */
-public class JavaParser implements JavaParserConstants {
- /**
- * Class to hold modifiers.
- */
- static public final class ModifierSet
- {
- /* Definitions of the bits in the modifiers field. */
- public static final int PUBLIC = 0x0001;
- public static final int PROTECTED = 0x0002;
- public static final int PRIVATE = 0x0004;
- public static final int ABSTRACT = 0x0008;
- public static final int STATIC = 0x0010;
- public static final int FINAL = 0x0020;
- public static final int SYNCHRONIZED = 0x0040;
- public static final int NATIVE = 0x0080;
- public static final int TRANSIENT = 0x0100;
- public static final int VOLATILE = 0x0200;
- public static final int STRICTFP = 0x1000;
-
- /** A set of accessors that indicate whether the specified modifier
- is in the set. */
-
- public static boolean isPublic(int modifiers)
- {
- return (modifiers & PUBLIC) != 0;
- }
-
- public static boolean isProtected(int modifiers)
- {
- return (modifiers & PROTECTED) != 0;
- }
-
- public static boolean isPrivate(int modifiers)
- {
- return (modifiers & PRIVATE) != 0;
- }
-
- public static boolean isStatic(int modifiers)
- {
- return (modifiers & STATIC) != 0;
- }
-
- public static boolean isAbstract(int modifiers)
- {
- return (modifiers & ABSTRACT) != 0;
- }
-
- public static boolean isFinal(int modifiers)
- {
- return (modifiers & FINAL) != 0;
- }
-
- public static boolean isNative(int modifiers)
- {
- return (modifiers & NATIVE) != 0;
- }
-
- public static boolean isStrictfp(int modifiers)
- {
- return (modifiers & STRICTFP) != 0;
- }
-
- public static boolean isSynchronized(int modifiers)
- {
- return (modifiers & SYNCHRONIZED) != 0;
- }
-
- public static boolean isTransient(int modifiers)
- {
- return (modifiers & TRANSIENT) != 0;
- }
-
- public static boolean isVolatile(int modifiers)
- {
- return (modifiers & VOLATILE) != 0;
- }
-
- /**
- * Removes the given modifier.
- */
- static int removeModifier(int modifiers, int mod)
- {
- return modifiers & ~mod;
- }
- }
-
-
-
- public static IXMLElement convert(Reader javaCode)
- throws JXMLException
- {
- try{
- JavaParser parser = new JavaParser(javaCode);
- IXMLElement root = parser.CompilationUnit();
- return root;
- }catch(ParseException e){
- throw new JXMLException(e.getMessage());
- }
- }
-
-
-
-
-
-
- private IXMLElement mergeElemsToBinary(LinkedList elems, LinkedList op){
- IXMLElement previous = (IXMLElement)elems.removeFirst();
- while (elems.size() > 0){
- IXMLElement next = (IXMLElement)elems.removeFirst();
- IXMLElement merge = new XMLElement();
- merge.setName("binary-expr");
- String operator = (String)op.removeFirst();
-
- // Faire la transformation des << ici
- operator = operator.replaceAll("<","<");
- operator = operator.replaceAll(">",">");
-
- merge.setAttribute("op",operator);
- merge.addChild(previous);
- merge.addChild(next);
- previous = merge;
- }
- return previous;
- }
-
- private void processModifiers(int modifiers, IXMLElement element)
- {
- boolean pri = ModifierSet.isPrivate(modifiers);
- boolean pub = ModifierSet.isPublic(modifiers);
- boolean pro = ModifierSet.isProtected(modifiers);
- if (pri)
- element.setAttribute("visibility","private");
- else if (pub)
- element.setAttribute("visibility","public");
- else if (pro)
- element.setAttribute("visibility","protected");
- else
- element.setAttribute("visibility","protected");
- //set abstract...
- if (ModifierSet.isAbstract(modifiers))
- element.setAttribute("abstract","true");
- if (ModifierSet.isFinal(modifiers))
- element.setAttribute("final","true");
- if (ModifierSet.isStatic(modifiers))
- element.setAttribute("static","true");
- if (ModifierSet.isSynchronized(modifiers))
- element.setAttribute("synchronized","true");
-
-
- }
-
-/*****************************************
- * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- *****************************************/
-
-/*
- * Program structuring syntax follows.
- */
-/**
- * Returns the IXMLElement corresponding to java-class-file
- */
- final public IXMLElement CompilationUnit() throws ParseException {
- IXMLElement javaSourceProgramElem = new XMLElement();
- javaSourceProgramElem.setName("java-class-file");
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PACKAGE:
- IXMLElement packageDeclElem;
- packageDeclElem = PackageDeclaration();
- javaSourceProgramElem.addChild(packageDeclElem);
- break;
- default:
- ;
- }
- label_1:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IMPORT:
- ;
- break;
- default:
- break label_1;
- }
- IXMLElement importElem;
- importElem = ImportDeclaration();
- javaSourceProgramElem.addChild(importElem);
- }
- label_2:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ABSTRACT:
- case CLASS:
- case ENUM:
- case FINAL:
- case INTERFACE:
- case NATIVE:
- case PRIVATE:
- case PROTECTED:
- case PUBLIC:
- case STATIC:
- case STRICTFP:
- case SYNCHRONIZED:
- case TRANSIENT:
- case VOLATILE:
- case SEMICOLON:
- case AT:
- ;
- break;
- default:
- break label_2;
- }
- IXMLElement classOrInterfaceElem;
- classOrInterfaceElem = TypeDeclaration();
- javaSourceProgramElem.addChild(classOrInterfaceElem);
- }
- jj_consume_token(0);
- {if (true) return javaSourceProgramElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * Returns the IXMLElement corresponding to a package Decleration
- * @return
- */
- final public IXMLElement PackageDeclaration() throws ParseException {
- IXMLElement packageDeclElem = new XMLElement();
- packageDeclElem.setName("package-decl");
- String name;
- jj_consume_token(PACKAGE);
- name = Name();
- jj_consume_token(SEMICOLON);
- packageDeclElem.setAttribute("name",name);
- {if (true) return packageDeclElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ImportDeclaration() throws ParseException {
- IXMLElement importElem = new XMLElement();
- importElem.setName("import");
- String name;
- jj_consume_token(IMPORT);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STATIC:
- jj_consume_token(STATIC);
- importElem.setAttribute("static","true");
- break;
- default:
- ;
- }
- name = Name();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case DOT:
- jj_consume_token(DOT);
- jj_consume_token(STAR);
- name += ".*";
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- importElem.setAttribute("module",name);
- {if (true) return importElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- * Modifiers. We match all modifiers in a single rule to reduce the chances of
- * syntax errors for simple modifier mistakes. It will also enable us to give
- * better error messages.
- */
- final public int Modifiers() throws ParseException {
- int modifiers = 0;
- label_3:
- while (true) {
- if (jj_2_1(2)) {
- ;
- } else {
- break label_3;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PUBLIC:
- jj_consume_token(PUBLIC);
- modifiers |= ModifierSet.PUBLIC;
- break;
- case STATIC:
- jj_consume_token(STATIC);
- modifiers |= ModifierSet.STATIC;
- break;
- case PROTECTED:
- jj_consume_token(PROTECTED);
- modifiers |= ModifierSet.PROTECTED;
- break;
- case PRIVATE:
- jj_consume_token(PRIVATE);
- modifiers |= ModifierSet.PRIVATE;
- break;
- case FINAL:
- jj_consume_token(FINAL);
- modifiers |= ModifierSet.FINAL;
- break;
- case ABSTRACT:
- jj_consume_token(ABSTRACT);
- modifiers |= ModifierSet.ABSTRACT;
- break;
- case SYNCHRONIZED:
- jj_consume_token(SYNCHRONIZED);
- modifiers |= ModifierSet.SYNCHRONIZED;
- break;
- case NATIVE:
- jj_consume_token(NATIVE);
- modifiers |= ModifierSet.NATIVE;
- break;
- case TRANSIENT:
- jj_consume_token(TRANSIENT);
- modifiers |= ModifierSet.TRANSIENT;
- break;
- case VOLATILE:
- jj_consume_token(VOLATILE);
- modifiers |= ModifierSet.VOLATILE;
- break;
- case STRICTFP:
- jj_consume_token(STRICTFP);
- modifiers |= ModifierSet.STRICTFP;
- break;
- case AT:
- Annotation();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return modifiers;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- * Declaration syntax follows.
- */
- final public IXMLElement TypeDeclaration() throws ParseException {
- int modifiers;
- IXMLElement typeDeclElem=null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SEMICOLON:
- jj_consume_token(SEMICOLON);
- break;
- case ABSTRACT:
- case CLASS:
- case ENUM:
- case FINAL:
- case INTERFACE:
- case NATIVE:
- case PRIVATE:
- case PROTECTED:
- case PUBLIC:
- case STATIC:
- case STRICTFP:
- case SYNCHRONIZED:
- case TRANSIENT:
- case VOLATILE:
- case AT:
- modifiers = Modifiers();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case CLASS:
- case INTERFACE:
- typeDeclElem = ClassOrInterfaceDeclaration(modifiers);
- break;
- case ENUM:
- EnumDeclaration(modifiers);
- break;
- case AT:
- AnnotationTypeDeclaration(modifiers);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return typeDeclElem;}
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
-
-/**
- *
- * @param modifiers
- * @return IXMLElement class Or interface IXMLElement
- */
- final public IXMLElement ClassOrInterfaceDeclaration(int modifiers) throws ParseException {
- boolean isInterface = false;
- IXMLElement classOrInterfaceElem = new XMLElement();
- Token t;
- IXMLElement temp;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case CLASS:
- jj_consume_token(CLASS);
- classOrInterfaceElem.setName("class");
- break;
- case INTERFACE:
- jj_consume_token(INTERFACE);
- isInterface = true;
- classOrInterfaceElem.setName("interface");
- if (ModifierSet.isPublic(modifiers))
- classOrInterfaceElem.setAttribute("visibility","public");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- t = jj_consume_token(IDENTIFIER);
- classOrInterfaceElem.setAttribute("name",t.image);
- processModifiers(modifiers, classOrInterfaceElem);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- temp = TypeParameters();
- classOrInterfaceElem.addChild(temp);
- break;
- default:
- ;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EXTENDS:
- ExtendsList(isInterface, classOrInterfaceElem);
- break;
- default:
- ;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IMPLEMENTS:
- ImplementsList(isInterface, classOrInterfaceElem);
- break;
- default:
- ;
- }
- ClassOrInterfaceBody(isInterface, classOrInterfaceElem);
- {if (true) return classOrInterfaceElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * Populates the element with the extendList...
- *
- * @param isInterface
- * @param element
- */
- final public void ExtendsList(boolean isInterface, IXMLElement element) throws ParseException {
- boolean extendsMoreThanOne = false;
- IXMLElement type = null;
- jj_consume_token(EXTENDS);
- type = ClassOrInterfaceType();
- String name = type.getAttribute("name");
- IXMLElement extend = new XMLElement();
- if (isInterface){
- extend.setName("extend");
- extend.setAttribute("interface",name);
- }else{
- extend.setName("superclass");
- extend.setAttribute("name",name);
- }
- element.addChild(extend);
- label_4:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_4;
- }
- jj_consume_token(COMMA);
- type = ClassOrInterfaceType();
- name = type.getAttribute("name");
- extendsMoreThanOne = true;
- IXMLElement extendMore = new XMLElement();
- extendMore.setName("extend");
- extendMore.setAttribute("name",name);
- element.addChild(extendMore);
- }
- if (extendsMoreThanOne && !isInterface)
- {if (true) throw new ParseException("A class cannot extend more than one other class");}
- }
-
- final public void ImplementsList(boolean isInterface, IXMLElement element) throws ParseException {
- IXMLElement type;
- jj_consume_token(IMPLEMENTS);
- type = ClassOrInterfaceType();
- String name = type.getAttribute("name");
- IXMLElement implementElem = new XMLElement();
- implementElem.setName("implement");
- implementElem.setAttribute("interface",name);
- element.addChild(implementElem);
- label_5:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_5;
- }
- jj_consume_token(COMMA);
- type = ClassOrInterfaceType();
- name = type.getAttribute("name");
- IXMLElement implementElemNext = new XMLElement();
- implementElemNext.setName("implement");
- implementElemNext.setAttribute("interface",name);
- element.addChild(implementElemNext);
- }
- if (isInterface)
- {if (true) throw new ParseException("An interface cannot implement other interfaces");}
- }
-
-/*
- * ditch enums for now...
- */
- final public void EnumDeclaration(int modifiers) throws ParseException {
- jj_consume_token(ENUM);
- jj_consume_token(IDENTIFIER);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IMPLEMENTS:
- ImplementsList(false, null);
- break;
- default:
- ;
- }
- EnumBody();
- }
-
- final public void EnumBody() throws ParseException {
- jj_consume_token(LBRACE);
- EnumConstant();
- label_6:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_6;
- }
- jj_consume_token(COMMA);
- EnumConstant();
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SEMICOLON:
- jj_consume_token(SEMICOLON);
- label_7:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ABSTRACT:
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case CLASS:
- case DOUBLE:
- case ENUM:
- case FINAL:
- case FLOAT:
- case INT:
- case INTERFACE:
- case LONG:
- case NATIVE:
- case PRIVATE:
- case PROTECTED:
- case PUBLIC:
- case SHORT:
- case STATIC:
- case STRICTFP:
- case SYNCHRONIZED:
- case TRANSIENT:
- case VOID:
- case VOLATILE:
- case IDENTIFIER:
- case LBRACE:
- case SEMICOLON:
- case AT:
- case LT:
- ;
- break;
- default:
- break label_7;
- }
- ClassOrInterfaceBodyDeclaration(false, null);
- }
- break;
- default:
- ;
- }
- jj_consume_token(RBRACE);
- }
-
- final public void EnumConstant() throws ParseException {
- jj_consume_token(IDENTIFIER);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
- Arguments();
- break;
- default:
- ;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACE:
- ClassOrInterfaceBody(false, null);
- break;
- default:
- ;
- }
- }
-
- final public IXMLElement TypeParameters() throws ParseException {
- IXMLElement typeParamElem = new XMLElement();
- typeParamElem.setName("type-parameters");
- IXMLElement temp;
- jj_consume_token(LT);
- temp = TypeParameter();
- typeParamElem.addChild(temp);
- label_8:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_8;
- }
- jj_consume_token(COMMA);
- temp = TypeParameter();
- typeParamElem.addChild(temp);
- }
- jj_consume_token(GT);
- {if (true) return typeParamElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement TypeParameter() throws ParseException {
- IXMLElement typeElem = new XMLElement();
- typeElem.setName("type-parameter");
- Token t;
- IXMLElement temp;
- t = jj_consume_token(IDENTIFIER);
- typeElem.setAttribute("name",t.image);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EXTENDS:
- temp = TypeBound();
- typeElem.addChild(temp);
- break;
- default:
- ;
- }
- {if (true) return typeElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement TypeBound() throws ParseException {
- IXMLElement boundsElem = new XMLElement();
- boundsElem.setName("bounds");
- IXMLElement temp;
- jj_consume_token(EXTENDS);
- temp = ClassOrInterfaceType();
- boundsElem.addChild(temp);
- label_9:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BIT_AND:
- ;
- break;
- default:
- break label_9;
- }
- jj_consume_token(BIT_AND);
- temp = ClassOrInterfaceType();
- boundsElem.addChild(temp);
- }
- {if (true) return boundsElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * process classOrInterface Body Declaration...
- *
- *
- */
- final public void ClassOrInterfaceBody(boolean isInterface, IXMLElement element) throws ParseException {
- jj_consume_token(LBRACE);
- label_10:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ABSTRACT:
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case CLASS:
- case DOUBLE:
- case ENUM:
- case FINAL:
- case FLOAT:
- case INT:
- case INTERFACE:
- case LONG:
- case NATIVE:
- case PRIVATE:
- case PROTECTED:
- case PUBLIC:
- case SHORT:
- case STATIC:
- case STRICTFP:
- case SYNCHRONIZED:
- case TRANSIENT:
- case VOID:
- case VOLATILE:
- case IDENTIFIER:
- case LBRACE:
- case SEMICOLON:
- case AT:
- case LT:
- ;
- break;
- default:
- break label_10;
- }
- ClassOrInterfaceBodyDeclaration(isInterface, element);
- }
- jj_consume_token(RBRACE);
- }
-
- final public void ClassOrInterfaceBodyDeclaration(boolean isInterface, IXMLElement element) throws ParseException {
- boolean isNestedInterface = false;
- int modifiers;
- IXMLElement temp;
- if (jj_2_4(2)) {
- temp = Initializer();
- element.addChild(temp);
- if (isInterface)
- {if (true) throw new ParseException("An interface cannot have initializers");}
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ABSTRACT:
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case CLASS:
- case DOUBLE:
- case ENUM:
- case FINAL:
- case FLOAT:
- case INT:
- case INTERFACE:
- case LONG:
- case NATIVE:
- case PRIVATE:
- case PROTECTED:
- case PUBLIC:
- case SHORT:
- case STATIC:
- case STRICTFP:
- case SYNCHRONIZED:
- case TRANSIENT:
- case VOID:
- case VOLATILE:
- case IDENTIFIER:
- case AT:
- case LT:
- modifiers = Modifiers();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case CLASS:
- case INTERFACE:
- temp = ClassOrInterfaceDeclaration(modifiers);
- System.err.println(temp);
- element.addChild(temp);
- break;
- case ENUM:
- EnumDeclaration(modifiers);
- break;
- default:
- if (jj_2_2(2147483647)) {
- temp = ConstructorDeclaration(modifiers);
- element.addChild(temp);
- } else if (jj_2_3(2147483647)) {
- FieldDeclaration(modifiers, element);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- case VOID:
- case IDENTIFIER:
- case LT:
- temp = MethodDeclaration(modifiers);
- element.addChild(temp);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- break;
- case SEMICOLON:
- jj_consume_token(SEMICOLON);
- IXMLElement emptyElem = new XMLElement();
- emptyElem.setName("empty");
- element.addChild(emptyElem);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
-
-/*
- <!ELEMENT field (type,(array-initializer|%expr-elems;)?)>
- <!ATTLIST field
- name CDATA #REQUIRED
- continued (true|false) #IMPLIED
- %visibility-attribute;
- %mod-final;
- %mod-static;
- %mod-volatile;
- %mod-transient;
- %location-info;>
- */
- final public void FieldDeclaration(int modifiers, IXMLElement element) throws ParseException {
- IXMLElement typeElem;
- IXMLElement fieldElem;
- // Modifiers are already matched in the caller
- typeElem = Type();
- fieldElem = new XMLElement();
- fieldElem.setName("field");
- fieldElem.addChild(XMLHelper.createCopy(typeElem));
- VariableDeclarator(fieldElem);
- processModifiers(modifiers, fieldElem);
- element.addChild(fieldElem);
- label_11:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_11;
- }
- jj_consume_token(COMMA);
- fieldElem = new XMLElement();
- fieldElem.setName("field");
-
- fieldElem.addChild(XMLHelper.createCopy(typeElem));
- VariableDeclarator(fieldElem);
- processModifiers(modifiers, fieldElem);
- element.addChild(fieldElem);
- }
- jj_consume_token(SEMICOLON);
- }
-
-//variableDecl gets already made element for it..
-//this is done because type has to be known before hand...
-//
- final public void VariableDeclarator(IXMLElement variableDeclElem) throws ParseException {
- String name;
- //element to hold the initializer
- IXMLElement variableInitializer;
- IXMLElement typeContainer=variableDeclElem.getFirstChildNamed("type");
- name = VariableDeclaratorId(typeContainer);
- variableDeclElem.setAttribute("name",name);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSIGN:
- jj_consume_token(ASSIGN);
- variableInitializer = VariableInitializer();
- variableDeclElem.addChild(variableInitializer);
- break;
- default:
- ;
- }
- }
-
- final public String VariableDeclaratorId(IXMLElement typeContainer) throws ParseException {
- Token t;
- String name;
- int dimensions = 0;
- String dimensionString = typeContainer.getAttribute("dimensions");
- if (dimensionString!=null){
- dimensions = Integer.parseInt(dimensionString);
- }
- t = jj_consume_token(IDENTIFIER);
- name = t.image;
- label_12:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACKET:
- ;
- break;
- default:
- break label_12;
- }
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- dimensions++;
- }
- if (dimensions>0)
- typeContainer.setAttribute("dimensions",""+dimensions+"");
-
- {if (true) return name;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement VariableInitializer() throws ParseException {
- IXMLElement variableInitElem;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACE:
- variableInitElem = ArrayInitializer();
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- variableInitElem = Expression();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return variableInitElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * <!ELEMENT array-initializer (array-initializer|%expr-elems;)*>
- * <!ATTLIST array-initializer
- * length CDATA #REQUIRED>
- */
- final public IXMLElement ArrayInitializer() throws ParseException {
- int length = 0;
- IXMLElement temp;
- IXMLElement arrayInitElem = new XMLElement();
- arrayInitElem.setName("array-initializer");
- jj_consume_token(LBRACE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- temp = VariableInitializer();
- arrayInitElem.addChild(temp);
- length++;
- label_13:
- while (true) {
- if (jj_2_5(2)) {
- ;
- } else {
- break label_13;
- }
- jj_consume_token(COMMA);
- temp = VariableInitializer();
- arrayInitElem.addChild(temp);
- length++;
- }
- break;
- default:
- ;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- break;
- default:
- ;
- }
- jj_consume_token(RBRACE);
- arrayInitElem.setAttribute("length",""+length+"");
- {if (true) return arrayInitElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
-<!ELEMENT method (type,formal-arguments,throws*,block?)>
-<!ATTLIST method
- name CDATA #REQUIRED
- id ID #REQUIRED
- %visibility-attribute;
- %mod-abstract;
- %mod-final;
- %mod-static;
- %mod-synchronized;
- %mod-volatile;
- %mod-transient;
- %mod-native;
- %location-info;>
-
-*/
- final public IXMLElement MethodDeclaration(int modifiers) throws ParseException {
- IXMLElement methodElem = new XMLElement();
- methodElem.setName("method");
-
- IXMLElement temp;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- temp = TypeParameters();
- methodElem.addChild(temp);
- break;
- default:
- ;
- }
- //TODO
- temp = ResultType();
- methodElem.addChild(temp);
- MethodDeclarator(methodElem);
- processModifiers(modifiers, methodElem);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case THROWS:
- jj_consume_token(THROWS);
- LinkedList l;
- l = NameList();
- Iterator iter = l.iterator();
- while(iter.hasNext()){
- String exceptionName = (String)iter.next();
- IXMLElement exceptionElem = new XMLElement();
- exceptionElem.setName("throws");
- exceptionElem.setAttribute("exception",exceptionName);
- methodElem.addChild(exceptionElem);
- }
- break;
- default:
- ;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACE:
- temp = Block();
- methodElem.addChild(temp);
- break;
- case SEMICOLON:
- jj_consume_token(SEMICOLON);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return methodElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public void MethodDeclarator(IXMLElement methodElem) throws ParseException {
- Token t;
- IXMLElement temp;
- IXMLElement typeElem = methodElem.getFirstChildNamed("type");
- String d = typeElem.getAttribute("dimensions");
- int dimensions = 0;
- if (d!=null)
- dimensions = Integer.parseInt(d);
- t = jj_consume_token(IDENTIFIER);
- methodElem.setAttribute("name",t.image);
- temp = FormalParameters();
- methodElem.addChild(temp);
- label_14:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACKET:
- ;
- break;
- default:
- break label_14;
- }
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- dimensions++;
- }
- if (dimensions>0)
- typeElem.setAttribute("dimensions",""+dimensions+"");
- }
-
-/*
-<!ELEMENT formal-arguments (formal-argument)*>
-*/
- final public IXMLElement FormalParameters() throws ParseException {
- IXMLElement formalArgElem = new XMLElement();
- formalArgElem.setName("formal-arguments");
- IXMLElement temp;
- jj_consume_token(LPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FINAL:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- case IDENTIFIER:
- temp = FormalParameter();
- formalArgElem.addChild(temp);
- label_15:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_15;
- }
- jj_consume_token(COMMA);
- temp = FormalParameter();
- formalArgElem.addChild(temp);
- }
- break;
- default:
- ;
- }
- jj_consume_token(RPAREN);
- {if (true) return formalArgElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- <!ELEMENT formal-argument (type)>
- <!ATTLIST formal-argument
- name CDATA #REQUIRED
- id ID #REQUIRED
- %mod-final;>
- */
- final public IXMLElement FormalParameter() throws ParseException {
- IXMLElement formalArgElem = new XMLElement();
- formalArgElem.setName("formal-argument");
- IXMLElement typeElem;
- String varName;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FINAL:
- jj_consume_token(FINAL);
- formalArgElem.setAttribute("final","true");
- break;
- default:
- ;
- }
- typeElem = Type();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ELLIPSIS:
- jj_consume_token(ELLIPSIS);
- break;
- default:
- ;
- }
- varName = VariableDeclaratorId(typeElem);
- formalArgElem.setAttribute("name",varName);
- formalArgElem.addChild(typeElem);
- {if (true) return formalArgElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
-<!ELEMENT constructor (formal-arguments,throws*,(super-call|this-call)?,(%stmt-elems;)?)>
-<!ATTLIST constructor
- name CDATA #REQUIRED
- id ID #REQUIRED
- %visibility-attribute;
- %mod-final;
- %mod-static;
- %mod-synchronized;
- %mod-volatile;
- %mod-transient;
- %mod-native;
- %location-info;>
-*/
- final public IXMLElement ConstructorDeclaration(int modifiers) throws ParseException {
- IXMLElement constructorElem = new XMLElement();
- constructorElem.setName("constructor");
- processModifiers(modifiers, constructorElem);
- Token t;
- IXMLElement temp;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- temp = TypeParameters();
- constructorElem.addChild(temp);
- break;
- default:
- ;
- }
- // Modifiers matched in the caller
- t = jj_consume_token(IDENTIFIER);
- temp = FormalParameters();
- constructorElem.setAttribute("name",t.image);
- constructorElem.addChild(temp);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case THROWS:
- LinkedList exceptionList;
- jj_consume_token(THROWS);
- exceptionList = NameList();
- Iterator it = exceptionList.iterator();
- while(it.hasNext()){
- String exceptionName = (String)it.next();
- IXMLElement throwsElem = new XMLElement();
- throwsElem.setName("throws");
- throwsElem.setAttribute("exception",exceptionName);
- constructorElem.addChild(throwsElem);
- }
- break;
- default:
- ;
- }
- jj_consume_token(LBRACE);
- if (jj_2_6(2147483647)) {
- temp = ExplicitConstructorInvocation();
- constructorElem.addChild(temp);
- } else {
- ;
- }
- label_16:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSERT:
- case BOOLEAN:
- case BREAK:
- case BYTE:
- case CHAR:
- case CLASS:
- case CONTINUE:
- case DO:
- case DOUBLE:
- case FALSE:
- case FINAL:
- case FLOAT:
- case FOR:
- case IF:
- case INT:
- case INTERFACE:
- case LONG:
- case NEW:
- case NULL:
- case RETURN:
- case SHORT:
- case SUPER:
- case SWITCH:
- case SYNCHRONIZED:
- case THIS:
- case THROW:
- case TRUE:
- case TRY:
- case VOID:
- case WHILE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case SEMICOLON:
- case INCR:
- case DECR:
- ;
- break;
- default:
- break label_16;
- }
- BlockStatement(constructorElem);
- }
- jj_consume_token(RBRACE);
- {if (true) return constructorElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ExplicitConstructorInvocation() throws ParseException {
- IXMLElement superOrThisCall = new XMLElement();
- IXMLElement argElem;
- IXMLElement temp;
- if (jj_2_8(2147483647)) {
- jj_consume_token(THIS);
- argElem = Arguments();
- jj_consume_token(SEMICOLON);
- superOrThisCall.setName("this-call");
- superOrThisCall.addChild(argElem);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- if (jj_2_7(2)) {
- temp = PrimaryExpression();
- jj_consume_token(DOT);
- superOrThisCall.addChild(temp);
- } else {
- ;
- }
- jj_consume_token(SUPER);
- argElem = Arguments();
- jj_consume_token(SEMICOLON);
- superOrThisCall.setName("super-call");
- superOrThisCall.addChild(argElem);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return superOrThisCall;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement Initializer() throws ParseException {
- IXMLElement initializerElement = new XMLElement();
- initializerElement.setName("instance-initializer");
- IXMLElement block;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STATIC:
- jj_consume_token(STATIC);
- initializerElement.setName("static-initializer");
- break;
- default:
- ;
- }
- block = Block();
- initializerElement.addChild(block);
- {if (true) return initializerElement;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- * Type, name and expression syntax follows.
- */
-/*
- * Parsing type
- * <!ELEMENT type EMPTY>
- * <!ATTLIST type
- * primitive CDATA #IMPLIED
- * name CDATA #REQUIRED
- * dimensions CDATA #IMPLIED
- * idref IDREF #IMPLIED>
- */
- final public IXMLElement Type() throws ParseException {
- IXMLElement typeElem;
- if (jj_2_9(2)) {
- typeElem = ReferenceType();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- typeElem = PrimitiveType();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return typeElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ReferenceType() throws ParseException {
- IXMLElement referenceType;
- int dimensions = 0;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- referenceType = PrimitiveType();
- label_17:
- while (true) {
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- dimensions++;
- if (jj_2_10(2)) {
- ;
- } else {
- break label_17;
- }
- }
- break;
- case IDENTIFIER:
- referenceType = ClassOrInterfaceType();
- label_18:
- while (true) {
- if (jj_2_11(2)) {
- ;
- } else {
- break label_18;
- }
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- dimensions++;
- }
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- if (dimensions>0)
- referenceType.setAttribute("dimensions",""+dimensions+"");
-
- {if (true) return referenceType;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ClassOrInterfaceType() throws ParseException {
- IXMLElement classOrInterfaceType = new XMLElement();
- classOrInterfaceType.setName("type");
- Token t;
- String name;
- t = jj_consume_token(IDENTIFIER);
- name = t.image;
- if (jj_2_12(2)) {
- TypeArguments(classOrInterfaceType);
- } else {
- ;
- }
- label_19:
- while (true) {
- if (jj_2_13(2)) {
- ;
- } else {
- break label_19;
- }
- jj_consume_token(DOT);
- t = jj_consume_token(IDENTIFIER);
- name += "."+t.image;
- if (jj_2_14(2)) {
- TypeArguments(classOrInterfaceType);
- } else {
- ;
- }
- }
- classOrInterfaceType.setAttribute("name",name);
- {if (true) return classOrInterfaceType;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- * parse typeArguments....
- *
- */
- final public void TypeArguments(IXMLElement typeElem) throws ParseException {
- IXMLElement temp;
- jj_consume_token(LT);
- temp = TypeArgument();
- typeElem.addChild(temp);
- label_20:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_20;
- }
- jj_consume_token(COMMA);
- temp = TypeArgument();
- typeElem.addChild(temp);
- }
- jj_consume_token(GT);
- }
-
-/*
- * a type Argument...
- * <!ELEMENT type-argument (type|wildcard)>
- * <!ELEMENT wildcard (bound?)>
- * <!ELEMENT bound (type)>
- * <!ATTLIST bound type (upper|lower) #REQUIRED>
- *
- */
- final public IXMLElement TypeArgument() throws ParseException {
- IXMLElement typeArgumentElem = new XMLElement();
- typeArgumentElem.setName("type-argument");
- IXMLElement temp=null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- case IDENTIFIER:
- temp = ReferenceType();
- typeArgumentElem.addChild(temp);
- break;
- case HOOK:
- jj_consume_token(HOOK);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EXTENDS:
- case SUPER:
- temp = WildcardBounds();
- break;
- default:
- ;
- }
- IXMLElement wildCard = new XMLElement();
- wildCard.setName("wildcard");
- if (temp!=null){
- //bound exist
- wildCard.addChild(temp);
- }
- typeArgumentElem.addChild(wildCard);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return typeArgumentElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * bound
- *
- *
- * @return
- */
- final public IXMLElement WildcardBounds() throws ParseException {
- IXMLElement boundElem = new XMLElement();
- boundElem.setName("bound");
- IXMLElement temp=null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EXTENDS:
- jj_consume_token(EXTENDS);
- temp = ReferenceType();
- boundElem.setAttribute("type","upper");
- boundElem.addChild(temp);
- break;
- case SUPER:
- jj_consume_token(SUPER);
- temp = ReferenceType();
- boundElem.setAttribute("type","lower");
- boundElem.addChild(temp);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return boundElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement PrimitiveType() throws ParseException {
- IXMLElement primitiveTypeElem = new XMLElement();
- primitiveTypeElem.setName("type");
- primitiveTypeElem.setAttribute("primitive","true");
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- jj_consume_token(BOOLEAN);
- primitiveTypeElem.setAttribute("name","boolean");
- break;
- case CHAR:
- jj_consume_token(CHAR);
- primitiveTypeElem.setAttribute("name","char");
- break;
- case BYTE:
- jj_consume_token(BYTE);
- primitiveTypeElem.setAttribute("name","byte");
- break;
- case SHORT:
- jj_consume_token(SHORT);
- primitiveTypeElem.setAttribute("name","short");
- break;
- case INT:
- jj_consume_token(INT);
- primitiveTypeElem.setAttribute("name","int");
- break;
- case LONG:
- jj_consume_token(LONG);
- primitiveTypeElem.setAttribute("name","long");
- break;
- case FLOAT:
- jj_consume_token(FLOAT);
- primitiveTypeElem.setAttribute("name","float");
- break;
- case DOUBLE:
- jj_consume_token(DOUBLE);
- primitiveTypeElem.setAttribute("name","double");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return primitiveTypeElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ResultType() throws ParseException {
- IXMLElement resultTypeElem;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case VOID:
- jj_consume_token(VOID);
- resultTypeElem = new XMLElement();
- resultTypeElem.setName("type");
- resultTypeElem.setAttribute("name","void");
- resultTypeElem.setAttribute("primitive","true");
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- case IDENTIFIER:
- resultTypeElem = Type();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return resultTypeElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public String Name() throws ParseException {
- String name = "";
- Token t;
- t = jj_consume_token(IDENTIFIER);
- name += t.image;
- label_21:
- while (true) {
- if (jj_2_15(2)) {
- ;
- } else {
- break label_21;
- }
- jj_consume_token(DOT);
- t = jj_consume_token(IDENTIFIER);
- name += "."+t.image;
- }
- {if (true) return name;}
- throw new Error("Missing return statement in function");
- }
-
- final public LinkedList NameList() throws ParseException {
- LinkedList l = new LinkedList();
- String temp;
- temp = Name();
- l.add(temp);
- label_22:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_22;
- }
- jj_consume_token(COMMA);
- temp = Name();
- l.add(temp);
- }
- {if (true) return l;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- * Expression syntax follows.
- */
- final public IXMLElement Expression() throws ParseException {
- IXMLElement expressionElement;
- boolean isAssignment = false;
- IXMLElement leftElement = null;
- IXMLElement rightElement = null;
- String operator=null;
- leftElement = ConditionalExpression();
- if (jj_2_16(2)) {
- operator = AssignmentOperator();
- rightElement = Expression();
- isAssignment = true;
- } else {
- ;
- }
- if (isAssignment){
- IXMLElement lvalueElement = new XMLElement();
- lvalueElement.setName("lvalue");
- lvalueElement.addChild(leftElement);
-
- expressionElement = new XMLElement();
- expressionElement.setName("assignment-expr");
- expressionElement.setAttribute("op",operator);
- //this has to be lvalue..
- expressionElement.addChild(lvalueElement);
- //this can be any expression
- expressionElement.addChild(rightElement);
- {if (true) return expressionElement;}
- }else{
- {if (true) return leftElement;}
- }
- throw new Error("Missing return statement in function");
- }
-
-/**
- * There are 12 assignment operators...
- * @return
- */
- final public String AssignmentOperator() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSIGN:
- jj_consume_token(ASSIGN);
- {if (true) return "=";}
- break;
- case STARASSIGN:
- jj_consume_token(STARASSIGN);
- {if (true) return "*=";}
- break;
- case SLASHASSIGN:
- jj_consume_token(SLASHASSIGN);
- {if (true) return "/=";}
- break;
- case REMASSIGN:
- jj_consume_token(REMASSIGN);
- {if (true) return "%=";}
- break;
- case PLUSASSIGN:
- jj_consume_token(PLUSASSIGN);
- {if (true) return "+=";}
- break;
- case MINUSASSIGN:
- jj_consume_token(MINUSASSIGN);
- {if (true) return "-=";}
- break;
- case LSHIFTASSIGN:
- jj_consume_token(LSHIFTASSIGN);
- {if (true) return "<<=";}
- break;
- case RSIGNEDSHIFTASSIGN:
- jj_consume_token(RSIGNEDSHIFTASSIGN);
- {if (true) return ">>=";}
- break;
- case RUNSIGNEDSHIFTASSIGN:
- jj_consume_token(RUNSIGNEDSHIFTASSIGN);
- {if (true) return ">>>=";}
- break;
- case ANDASSIGN:
- jj_consume_token(ANDASSIGN);
- {if (true) return "&=";}
- break;
- case XORASSIGN:
- jj_consume_token(XORASSIGN);
- {if (true) return "^=";}
- break;
- case ORASSIGN:
- jj_consume_token(ORASSIGN);
- {if (true) return "|=";}
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
-
-/**
- *
- * @return the conditional expression...
- */
- final public IXMLElement ConditionalExpression() throws ParseException {
- IXMLElement conditionalElem;
- IXMLElement conditionalOrElem;
- IXMLElement trueExprElem=null, falseExprElem=null;
- boolean isConditional = false;
- conditionalOrElem = ConditionalOrExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case HOOK:
- jj_consume_token(HOOK);
- trueExprElem = Expression();
- jj_consume_token(COLON);
- falseExprElem = Expression();
- isConditional = true;
- break;
- default:
- ;
- }
- if (isConditional){
- conditionalElem = new XMLElement();
- conditionalElem.setName("conditional-expr");
- conditionalElem.addChild(conditionalOrElem);
- conditionalElem.addChild(trueExprElem);
- conditionalElem.addChild(falseExprElem);
- {if (true) return conditionalElem;}
- }else{
- {if (true) return conditionalOrElem;}
- }
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ConditionalOrExpression() throws ParseException {
- LinkedList conditionalAndElem=new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp=null;
- temp = ConditionalAndExpression();
- conditionalAndElem.add(temp);
- label_23:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SC_OR:
- ;
- break;
- default:
- break label_23;
- }
- jj_consume_token(SC_OR);
- temp = ConditionalAndExpression();
- System.out.println("hello ");
- conditionalAndElem.add(temp);
- operator.add("||");
- }
- {if (true) return mergeElemsToBinary(conditionalAndElem, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ConditionalAndExpression() throws ParseException {
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp=null;
- temp = InclusiveOrExpression();
- elemList.add(temp);
- label_24:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case SC_AND:
- ;
- break;
- default:
- break label_24;
- }
- jj_consume_token(SC_AND);
- temp = InclusiveOrExpression();
- operator.add("&&");
- elemList.add(temp);
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement InclusiveOrExpression() throws ParseException {
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp;
- temp = ExclusiveOrExpression();
- elemList.add(temp);
- label_25:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BIT_OR:
- ;
- break;
- default:
- break label_25;
- }
- jj_consume_token(BIT_OR);
- temp = ExclusiveOrExpression();
- elemList.add(temp);
- operator.add("|");
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ExclusiveOrExpression() throws ParseException {
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp;
- temp = AndExpression();
- elemList.add(temp);
- label_26:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case XOR:
- ;
- break;
- default:
- break label_26;
- }
- jj_consume_token(XOR);
- temp = AndExpression();
- elemList.add(temp);
- operator.add("^");
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement AndExpression() throws ParseException {
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp;
- temp = EqualityExpression();
- elemList.add(temp);
- label_27:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BIT_AND:
- ;
- break;
- default:
- break label_27;
- }
- jj_consume_token(BIT_AND);
- temp = EqualityExpression();
- elemList.add(temp);
- operator.add("&");
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement EqualityExpression() throws ParseException {
- IXMLElement temp;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- temp = InstanceOfExpression();
- elemList.add(temp);
- label_28:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EQ:
- case NE:
- ;
- break;
- default:
- break label_28;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case EQ:
- jj_consume_token(EQ);
- operator.add("==");
- break;
- case NE:
- jj_consume_token(NE);
- operator.add("!=");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- temp = InstanceOfExpression();
- elemList.add(temp);
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement InstanceOfExpression() throws ParseException {
- IXMLElement instanceOfElem = new XMLElement();
- instanceOfElem.setName("instanceof-test");
- IXMLElement relationalElem=null;
- IXMLElement type=null;
- boolean isInstanceOf = false;
- relationalElem = RelationalExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INSTANCEOF:
- jj_consume_token(INSTANCEOF);
- type = Type();
- isInstanceOf = true;
- break;
- default:
- ;
- }
- if (isInstanceOf){
- instanceOfElem.addChild(relationalElem);
- instanceOfElem.addChild(type);
- {if (true) return instanceOfElem;}
- }else
- {if (true) return relationalElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement RelationalExpression() throws ParseException {
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- temp = ShiftExpression();
- elemList.add(temp);
- label_29:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- case LE:
- case GE:
- case GT:
- ;
- break;
- default:
- break label_29;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- jj_consume_token(LT);
- operator.add("<");
- break;
- case GT:
- jj_consume_token(GT);
- operator.add(">");
- break;
- case LE:
- jj_consume_token(LE);
- operator.add("<=");
- break;
- case GE:
- jj_consume_token(GE);
- operator.add(">=");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- temp = ShiftExpression();
- elemList.add(temp);
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ShiftExpression() throws ParseException {
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- String storeOp=null;
- temp = AdditiveExpression();
- elemList.add(temp);
- label_30:
- while (true) {
- if (jj_2_17(1)) {
- ;
- } else {
- break label_30;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LSHIFT:
- jj_consume_token(LSHIFT);
- operator.add("<<");
- break;
- default:
- if (jj_2_18(1)) {
- storeOp = RSIGNEDSHIFT();
- operator.add(storeOp);
- } else if (jj_2_19(1)) {
- storeOp = RUNSIGNEDSHIFT();
- operator.add(storeOp);
- } else {
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- temp = AdditiveExpression();
- elemList.add(temp);
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement AdditiveExpression() throws ParseException {
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- temp = MultiplicativeExpression();
- elemList.add(temp);
- label_31:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- case MINUS:
- ;
- break;
- default:
- break label_31;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- jj_consume_token(PLUS);
- operator.add("+");
- break;
- case MINUS:
- jj_consume_token(MINUS);
- operator.add("-");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- temp = MultiplicativeExpression();
- elemList.add(temp);
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement MultiplicativeExpression() throws ParseException {
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- temp = UnaryExpression();
- elemList.add(temp);
- label_32:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
- case SLASH:
- case REM:
- ;
- break;
- default:
- break label_32;
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case STAR:
- jj_consume_token(STAR);
- operator.add("*");
- break;
- case SLASH:
- jj_consume_token(SLASH);
- operator.add("/");
- break;
- case REM:
- jj_consume_token(REM);
- operator.add("%");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- temp = UnaryExpression();
- elemList.add(temp);
- }
- {if (true) return mergeElemsToBinary(elemList, operator);}
- throw new Error("Missing return statement in function");
- }
-
-/**
- *
- * @return unary-expr
- */
- final public IXMLElement UnaryExpression() throws ParseException {
- IXMLElement unaryElem=null;
- IXMLElement temp=null;
- String op=null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- case MINUS:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case PLUS:
- jj_consume_token(PLUS);
- op="+";
- break;
- case MINUS:
- jj_consume_token(MINUS);
- op="-";
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- temp = UnaryExpression();
- unaryElem = new XMLElement();
- unaryElem.setName("unary-expr");
- unaryElem.setAttribute("op",op);
- unaryElem.addChild(temp);
- break;
- case INCR:
- unaryElem = PreIncrementExpression();
- break;
- case DECR:
- unaryElem = PreDecrementExpression();
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- unaryElem = UnaryExpressionNotPlusMinus();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return unaryElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement PreIncrementExpression() throws ParseException {
- IXMLElement unaryElem = new XMLElement();
- unaryElem.setName("unary-expr");
- unaryElem.setAttribute("post","false");
- unaryElem.setAttribute("op","++");
- IXMLElement temp=null;
- jj_consume_token(INCR);
- temp = PrimaryExpression();
- unaryElem.addChild(temp);
- {if (true) return unaryElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement PreDecrementExpression() throws ParseException {
- IXMLElement unaryElem = new XMLElement();
- unaryElem.setName("unary-expr");
- unaryElem.setAttribute("post","false");
- unaryElem.setAttribute("op","--");
- IXMLElement temp=null;
- jj_consume_token(DECR);
- temp = PrimaryExpression();
- unaryElem.addChild(temp);
- {if (true) return unaryElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement UnaryExpressionNotPlusMinus() throws ParseException {
- IXMLElement unaryExprElem=null;
- IXMLElement temp=null;
- String op=null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BANG:
- case TILDE:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case TILDE:
- jj_consume_token(TILDE);
- op="~";
- break;
- case BANG:
- jj_consume_token(BANG);
- op="!";
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- temp = UnaryExpression();
- unaryExprElem = new XMLElement();
- unaryExprElem.setName("unary-expr");
- unaryExprElem.setAttribute("op",op);
- unaryExprElem.addChild(temp);
- break;
- default:
- if (jj_2_20(2147483647)) {
- unaryExprElem = CastExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- unaryExprElem = PostfixExpression();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- {if (true) return unaryExprElem;}
- throw new Error("Missing return statement in function");
- }
-
-// This production is to determine lookahead only. The LOOKAHEAD specifications
-// below are not used, but they are there just to indicate that we know about
-// this.
- final public void CastLookahead() throws ParseException {
- if (jj_2_21(2)) {
- jj_consume_token(LPAREN);
- PrimitiveType();
- } else if (jj_2_22(2147483647)) {
- jj_consume_token(LPAREN);
- Type();
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
- jj_consume_token(LPAREN);
- Type();
- jj_consume_token(RPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case TILDE:
- jj_consume_token(TILDE);
- break;
- case BANG:
- jj_consume_token(BANG);
- break;
- case LPAREN:
- jj_consume_token(LPAREN);
- break;
- case IDENTIFIER:
- jj_consume_token(IDENTIFIER);
- break;
- case THIS:
- jj_consume_token(THIS);
- break;
- case SUPER:
- jj_consume_token(SUPER);
- break;
- case NEW:
- jj_consume_token(NEW);
- break;
- case FALSE:
- case NULL:
- case TRUE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- Literal();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
-
-/**
- * parse postfix unary-expr
- * @return
- */
- final public IXMLElement PostfixExpression() throws ParseException {
- IXMLElement unaryExpr = null;
- IXMLElement temp;
- String op=null;
- boolean isPostfix=false;
- temp = PrimaryExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INCR:
- case DECR:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INCR:
- jj_consume_token(INCR);
- isPostfix=true;op="++";
- break;
- case DECR:
- jj_consume_token(DECR);
- isPostfix=true;op="--";
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- default:
- ;
- }
- if (isPostfix){
- unaryExpr = new XMLElement();
- unaryExpr.setName("unary-expr");
- unaryExpr.setAttribute("post","true");
- unaryExpr.setAttribute("op",op);
- unaryExpr.addChild(temp);
- {if (true) return unaryExpr;}
- }else{
- {if (true) return temp;}
- }
- throw new Error("Missing return statement in function");
- }
-
-/**
- * <!ELEMENT cast-expr (type,(%expr-elems;))>
- * @return
- */
- final public IXMLElement CastExpression() throws ParseException {
- IXMLElement castExprElem = new XMLElement();
- castExprElem.setName("cast-expr");
- IXMLElement typeElem = null;
- IXMLElement exprElem = null;
- if (jj_2_23(2147483647)) {
- jj_consume_token(LPAREN);
- typeElem = Type();
- jj_consume_token(RPAREN);
- exprElem = UnaryExpression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LPAREN:
- jj_consume_token(LPAREN);
- typeElem = Type();
- jj_consume_token(RPAREN);
- exprElem = UnaryExpressionNotPlusMinus();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- castExprElem.addChild(typeElem);
- castExprElem.addChild(exprElem);
- {if (true) return castExprElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * parses the primary expression....
- * @return
- */
- final public IXMLElement PrimaryExpression() throws ParseException {
- IXMLElement primaryElement;
- primaryElement = PrimaryPrefix();
- label_33:
- while (true) {
- if (jj_2_24(2)) {
- ;
- } else {
- break label_33;
- }
- primaryElement = PrimarySuffix(primaryElement);
- }
- {if (true) return primaryElement;}
- throw new Error("Missing return statement in function");
- }
-
- final public void MemberSelector() throws ParseException {
- jj_consume_token(DOT);
- TypeArguments(null);
- jj_consume_token(IDENTIFIER);
- }
-
- final public IXMLElement PrimaryPrefix() throws ParseException {
- IXMLElement prefixElement;
- Token t;
- IXMLElement temp;
- IXMLElement typeElem;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FALSE:
- case NULL:
- case TRUE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- prefixElement = Literal();
- break;
- case THIS:
- jj_consume_token(THIS);
- prefixElement = new XMLElement();
- prefixElement.setName("this");
- break;
- case SUPER:
- jj_consume_token(SUPER);
- jj_consume_token(DOT);
- t = jj_consume_token(IDENTIFIER);
- IXMLElement superElem = new XMLElement();
- superElem.setName("super");
- IXMLElement fieldAccess = new XMLElement();
- fieldAccess.setName("field-access");
- fieldAccess.setAttribute("field",t.image);
- fieldAccess.addChild(superElem);
- prefixElement = fieldAccess;
- break;
- case LPAREN:
- jj_consume_token(LPAREN);
- temp = Expression();
- jj_consume_token(RPAREN);
- IXMLElement parenElement = new XMLElement();
- parenElement.setName("paren");
- parenElement.addChild(temp);
- prefixElement = parenElement;
- break;
- case NEW:
- prefixElement = AllocationExpression();
- break;
- default:
- if (jj_2_25(2147483647)) {
- typeElem = ResultType();
- jj_consume_token(DOT);
- jj_consume_token(CLASS);
- IXMLElement fieldAccess2 = new XMLElement();
- fieldAccess2.setName("field-access");
- fieldAccess2.setAttribute("field", "class");
- fieldAccess2.addChild(typeElem);
- prefixElement = fieldAccess2;
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER:
- t = jj_consume_token(IDENTIFIER);
- prefixElement = new XMLElement();
- prefixElement.setName("var-ref");
- prefixElement.setAttribute("name",t.image);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
- {if (true) return prefixElement;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement PrimarySuffix(IXMLElement prefixElement) throws ParseException {
- IXMLElement suffixElement=null;
- Token t=null;
- IXMLElement temp;
- if (jj_2_26(2)) {
- jj_consume_token(DOT);
- jj_consume_token(THIS);
- suffixElement = new XMLElement();
- suffixElement.setName("field-access");
- suffixElement.setAttribute("field","this");
- suffixElement.addChild(prefixElement);
- } else if (jj_2_27(2)) {
- jj_consume_token(DOT);
- temp = AllocationExpression();
-
- } else if (jj_2_28(3)) {
- MemberSelector();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACKET:
- jj_consume_token(LBRACKET);
- temp = Expression();
- jj_consume_token(RBRACKET);
- suffixElement = new XMLElement();
- suffixElement.setName("array-ref");
- IXMLElement baseElem = new XMLElement();
- baseElem.setName("base");
- baseElem.addChild(prefixElement);
- IXMLElement offsetElem = new XMLElement();
- offsetElem.setName("offset");
- offsetElem.addChild(temp);
- suffixElement.addChild(baseElem);
- suffixElement.addChild(offsetElem);
- break;
- case DOT:
- jj_consume_token(DOT);
- t = jj_consume_token(IDENTIFIER);
- suffixElement = new XMLElement();
- suffixElement.setName("field-access");
- suffixElement.setAttribute("field",t.image);
- suffixElement.addChild(prefixElement);
- break;
- case LPAREN:
- temp = Arguments();
- /*
- * well so the argument is called... now previous element's root should be
- * a field-access or a var-ref
- * else we don't know what to do...
- */
- suffixElement = new XMLElement();
- suffixElement.setName("send");
-
- if (prefixElement.getName().equals("field-access")){
- //modify this....
- suffixElement.setAttribute("message",prefixElement.getAttribute("field"));
- IXMLElement targetElem = new XMLElement();
- targetElem.setName("target");
- targetElem.addChild(prefixElement.getChildAtIndex(0));
- suffixElement.addChild(targetElem);
- suffixElement.addChild(temp);
-
- }else if (prefixElement.getName().equals("var-ref")){
- suffixElement.setAttribute("message", prefixElement.getAttribute("name"));
- suffixElement.addChild(temp);
- }
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return suffixElement;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- *
- * @return the IXMLElement corresponding to the literal
- */
- final public IXMLElement Literal() throws ParseException {
- Token t;
- IXMLElement literalElement = new XMLElement();
- String temp;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INTEGER_LITERAL:
- t = jj_consume_token(INTEGER_LITERAL);
- literalElement.setName("literal-number");
- literalElement.setAttribute("kind","integer");
- literalElement.setAttribute("value",t.image);
- break;
- case FLOATING_POINT_LITERAL:
- t = jj_consume_token(FLOATING_POINT_LITERAL);
- literalElement.setName("literal-number");
- literalElement.setAttribute("kind","float");
- literalElement.setAttribute("value",t.image);
- break;
- case CHARACTER_LITERAL:
- t = jj_consume_token(CHARACTER_LITERAL);
- literalElement.setName("literal-char");
- literalElement.setAttribute("value",t.image);
- break;
- case STRING_LITERAL:
- t = jj_consume_token(STRING_LITERAL);
- literalElement.setName("literal-string");
- literalElement.setAttribute("value",t.image);
- break;
- case FALSE:
- case TRUE:
- temp = BooleanLiteral();
- literalElement.setName("literal-boolean");
- literalElement.setAttribute("value", temp);
- break;
- case NULL:
- NullLiteral();
- literalElement.setName("literal-null");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return literalElement;}
- throw new Error("Missing return statement in function");
- }
-
- final public String BooleanLiteral() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case TRUE:
- jj_consume_token(TRUE);
- {if (true) return "true";}
- break;
- case FALSE:
- jj_consume_token(FALSE);
- {if (true) return "false";}
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- throw new Error("Missing return statement in function");
- }
-
- final public void NullLiteral() throws ParseException {
- jj_consume_token(NULL);
- }
-
-/**
- *
- * @return an arguments type element
- */
- final public IXMLElement Arguments() throws ParseException {
- IXMLElement argumentElem = new XMLElement();
- argumentElem.setName("arguments");
- jj_consume_token(LPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- ArgumentList(argumentElem);
- break;
- default:
- ;
- }
- jj_consume_token(RPAREN);
- {if (true) return argumentElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public void ArgumentList(IXMLElement argumentElem) throws ParseException {
- IXMLElement temp;
- temp = Expression();
- argumentElem.addChild(temp);
- label_34:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_34;
- }
- jj_consume_token(COMMA);
- temp = Expression();
- argumentElem.addChild(temp);
- }
- }
-
- final public IXMLElement AllocationExpression() throws ParseException {
- IXMLElement newElement;//can be new or new-array
-
- IXMLElement typeElem;
- if (jj_2_29(2)) {
- jj_consume_token(NEW);
- typeElem = PrimitiveType();
- newElement = new XMLElement();
- newElement.setName("new-array");
- newElement.addChild(typeElem);
- ArrayDimsAndInits(newElement);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case NEW:
- jj_consume_token(NEW);
- typeElem = ClassOrInterfaceType();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LT:
- TypeArguments(typeElem);
- break;
- default:
- ;
- }
- newElement = new XMLElement();
- //newElement.setName("new-array"); cant decide now
- newElement.addChild(typeElem);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACKET:
- ArrayDimsAndInits(newElement);
- newElement.setName("new-array");
- break;
- case LPAREN:
- IXMLElement argumentsElem;
- IXMLElement anonymousElem = null;
- argumentsElem = Arguments();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACE:
- anonymousElem = new XMLElement();
- anonymousElem.setName("anonymous-class");
- ClassOrInterfaceBody(false, anonymousElem);
- break;
- default:
- ;
- }
- newElement.setName("new");
- newElement.addChild(argumentsElem);
- if (anonymousElem!=null)
- newElement.addChild(anonymousElem);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return newElement;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- * The third LOOKAHEAD specification below is to parse to PrimarySuffix
- * if there is an expression between the "[...]".
- */
- final public void ArrayDimsAndInits(IXMLElement element) throws ParseException {
- IXMLElement temp;
- int dimensions = 0;
- if (jj_2_32(2)) {
- label_35:
- while (true) {
- jj_consume_token(LBRACKET);
- temp = Expression();
- jj_consume_token(RBRACKET);
- IXMLElement dimElem = new XMLElement();
- dimElem.setName("dim-expr");
- dimElem.addChild(temp);
- element.addChild(dimElem);
- dimensions++;
- if (jj_2_30(2)) {
- ;
- } else {
- break label_35;
- }
- }
- label_36:
- while (true) {
- if (jj_2_31(2)) {
- ;
- } else {
- break label_36;
- }
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- IXMLElement dimElem = new XMLElement();
- dimElem.setName("dim-expr");
- element.addChild(dimElem);
- dimensions++;
- }
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACKET:
- label_37:
- while (true) {
- jj_consume_token(LBRACKET);
- jj_consume_token(RBRACKET);
- IXMLElement dimElem = new XMLElement();
- dimElem.setName("dim-expr");
- element.addChild(dimElem);
- dimensions++;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case LBRACKET:
- ;
- break;
- default:
- break label_37;
- }
- }
- temp = ArrayInitializer();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- element.setAttribute("dimensions",""+dimensions+"");
- }
-
-/*
- * Statement syntax follows.
- */
- final public IXMLElement Statement() throws ParseException {
- IXMLElement statement=null;
- if (jj_2_33(2)) {
- statement = LabeledStatement();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSERT:
- statement = AssertStatement();
- break;
- case LBRACE:
- statement = Block();
- break;
- case SEMICOLON:
- statement = EmptyStatement();
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case INCR:
- case DECR:
- statement = StatementExpression();
- jj_consume_token(SEMICOLON);
- break;
- case SWITCH:
- statement = SwitchStatement();
- break;
- case IF:
- statement = IfStatement();
- break;
- case WHILE:
- statement = WhileStatement();
- break;
- case DO:
- statement = DoStatement();
- break;
- case FOR:
- statement = ForStatement();
- break;
- case BREAK:
- statement = BreakStatement();
- break;
- case CONTINUE:
- statement = ContinueStatement();
- break;
- case RETURN:
- statement = ReturnStatement();
- break;
- case THROW:
- statement = ThrowStatement();
- break;
- case SYNCHRONIZED:
- statement = SynchronizedStatement();
- break;
- case TRY:
- statement = TryStatement();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return statement;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * <!ELEMENT assert (condition,error-message?)>
- * <!ELEMENT condition (%expr-elems;)>
- * <!ELEMENT error-message (%expr-elems;)>
- */
- final public IXMLElement AssertStatement() throws ParseException {
- IXMLElement assertElem = new XMLElement();
- assertElem.setName("assert");
- IXMLElement conditionElem = new XMLElement();
- conditionElem.setName("condition");
- IXMLElement expr1, expr2;
- jj_consume_token(ASSERT);
- expr1 = Expression();
- conditionElem.addChild(expr1);
- assertElem.addChild(conditionElem);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COLON:
- jj_consume_token(COLON);
- expr2 = Expression();
- IXMLElement errorElem = new XMLElement();
- errorElem.setName("error-message");
- errorElem.addChild(expr2);
- assertElem.addChild(errorElem);
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- {if (true) return assertElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * Parse the labeled Statement
- */
- final public IXMLElement LabeledStatement() throws ParseException {
- Token t;
- IXMLElement statementElem;
- t = jj_consume_token(IDENTIFIER);
- jj_consume_token(COLON);
- statementElem = Statement();
- IXMLElement labelElem = new XMLElement();
- labelElem.setName("label");
- labelElem.setAttribute("name",t.image);
- labelElem.addChild(statementElem);
- {if (true) return labelElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * pass element to Block as there are many elements to be added
- * @param element
- * @return
- */
- final public IXMLElement Block() throws ParseException {
- IXMLElement block = new XMLElement();
- block.setName("block");
- jj_consume_token(LBRACE);
- label_38:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSERT:
- case BOOLEAN:
- case BREAK:
- case BYTE:
- case CHAR:
- case CLASS:
- case CONTINUE:
- case DO:
- case DOUBLE:
- case FALSE:
- case FINAL:
- case FLOAT:
- case FOR:
- case IF:
- case INT:
- case INTERFACE:
- case LONG:
- case NEW:
- case NULL:
- case RETURN:
- case SHORT:
- case SUPER:
- case SWITCH:
- case SYNCHRONIZED:
- case THIS:
- case THROW:
- case TRUE:
- case TRY:
- case VOID:
- case WHILE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case SEMICOLON:
- case INCR:
- case DECR:
- ;
- break;
- default:
- break label_38;
- }
- BlockStatement(block);
- }
- jj_consume_token(RBRACE);
- {if (true) return block;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * Block statement...
- * A block consists of many such block statements.....
- *
- */
- final public void BlockStatement(IXMLElement element) throws ParseException {
- boolean isFinal = false;
- IXMLElement temp;
- if (jj_2_34(2147483647)) {
- LocalVariableDeclaration(element);
- jj_consume_token(SEMICOLON);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSERT:
- case BOOLEAN:
- case BREAK:
- case BYTE:
- case CHAR:
- case CONTINUE:
- case DO:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case FOR:
- case IF:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case RETURN:
- case SHORT:
- case SUPER:
- case SWITCH:
- case SYNCHRONIZED:
- case THIS:
- case THROW:
- case TRUE:
- case TRY:
- case VOID:
- case WHILE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case SEMICOLON:
- case INCR:
- case DECR:
- temp = Statement();
- if (temp!=null)
- element.addChild(temp);
- break;
- case CLASS:
- case INTERFACE:
- ClassOrInterfaceDeclaration(0);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
-
- final public void LocalVariableDeclaration(IXMLElement element) throws ParseException {
- IXMLElement temp;
- boolean isFinal=false;
- IXMLElement type;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FINAL:
- jj_consume_token(FINAL);
- isFinal = true;
- break;
- default:
- ;
- }
- type = Type();
- temp=new XMLElement();
- temp.setName("local-variable");
- temp.addChild(XMLHelper.createCopy(type));
- if (isFinal){
- temp.setAttribute("final","true");
- }
- VariableDeclarator(temp);
- element.addChild(temp);
- label_39:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_39;
- }
- jj_consume_token(COMMA);
- temp = new XMLElement();
- temp.setName("local-variable");
- temp.addChild(XMLHelper.createCopy(type));
- if (isFinal){
- temp.setAttribute("final","true");
- }
- temp.setAttribute("continued","true");
- VariableDeclarator(temp);
- element.addChild(temp);
- }
- }
-
- final public IXMLElement EmptyStatement() throws ParseException {
- IXMLElement emptyElem = new XMLElement();
- emptyElem.setName("empty");
- jj_consume_token(SEMICOLON);
- {if (true) return emptyElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement StatementExpression() throws ParseException {
- IXMLElement statementExpressionElem=null;
- IXMLElement temp=null;
- String operator=null;
- IXMLElement rightExpr = null;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INCR:
- statementExpressionElem = PreIncrementExpression();
- break;
- case DECR:
- statementExpressionElem = PreDecrementExpression();
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- temp = PrimaryExpression();
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSIGN:
- case INCR:
- case DECR:
- case PLUSASSIGN:
- case MINUSASSIGN:
- case STARASSIGN:
- case SLASHASSIGN:
- case ANDASSIGN:
- case ORASSIGN:
- case XORASSIGN:
- case REMASSIGN:
- case LSHIFTASSIGN:
- case RSIGNEDSHIFTASSIGN:
- case RUNSIGNEDSHIFTASSIGN:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case INCR:
- jj_consume_token(INCR);
- statementExpressionElem = new XMLElement();
- statementExpressionElem.setName("unary-expr");
- statementExpressionElem.setAttribute("op","++");
- statementExpressionElem.setAttribute("post","true");
- statementExpressionElem.addChild(temp);
- break;
- case DECR:
- jj_consume_token(DECR);
- statementExpressionElem = new XMLElement();
- statementExpressionElem.setName("unary-expr");
- statementExpressionElem.setAttribute("op","--");
- statementExpressionElem.setAttribute("post","true");
- statementExpressionElem.addChild(temp);
- break;
- case ASSIGN:
- case PLUSASSIGN:
- case MINUSASSIGN:
- case STARASSIGN:
- case SLASHASSIGN:
- case ANDASSIGN:
- case ORASSIGN:
- case XORASSIGN:
- case REMASSIGN:
- case LSHIFTASSIGN:
- case RSIGNEDSHIFTASSIGN:
- case RUNSIGNEDSHIFTASSIGN:
- operator = AssignmentOperator();
- rightExpr = Expression();
- statementExpressionElem = new XMLElement();
- statementExpressionElem.setName("assignment-expr");
- statementExpressionElem.setAttribute("op",operator);
- IXMLElement lvalueElem = new XMLElement();
- lvalueElem.setName("lvalue");
- lvalueElem.addChild(temp);
- statementExpressionElem.addChild(lvalueElem);
- statementExpressionElem.addChild(rightExpr);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- break;
- default:
- ;
- }
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- if (statementExpressionElem==null)
- statementExpressionElem = temp;
- {if (true) return statementExpressionElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- * <!ELEMENT switch ((%expr-elems;),switch-block+)>
- * <!ELEMENT switch-block ((case|default-case)+,(%stmt-elems;)*)>
- * <!ELEMENT case (%expr-elems;)>
- * <!ELEMENT default-case EMPTY>
- */
- final public IXMLElement SwitchStatement() throws ParseException {
- IXMLElement switchElem = new XMLElement();
- switchElem.setName("switch");
- IXMLElement exprElem;
- jj_consume_token(SWITCH);
- jj_consume_token(LPAREN);
- exprElem = Expression();
- jj_consume_token(RPAREN);
- jj_consume_token(LBRACE);
- switchElem.addChild(exprElem); // On ajoute l'expression dans le switch
- System.out.println(exprElem.getAttribute("name"));
- label_40:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case CASE:
- case _DEFAULT:
- ;
- break;
- default:
- break label_40;
- }
- IXMLElement switchBlockElem = new XMLElement();
- switchBlockElem.setName("switch-block"); // On ajoute un Switch block qui contient le case, et le bordel
-
- // On ajoute un block pour le block des switch afin d'être propre, sinon c'est l'auberge espagnole !
- IXMLElement switchBlockInterne = new XMLElement();
- switchBlockInterne.setName("block");
- switchElem.addChild(switchBlockElem);
-
- IXMLElement caseElem;
- caseElem = SwitchLabel();
- switchBlockElem.addChild(caseElem);
- // On créé la balise block...
- //switchBlockElem.addChild(switchBlockInterne);
-
- label_41:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ASSERT:
- case BOOLEAN:
- case BREAK:
- case BYTE:
- case CHAR:
- case CLASS:
- case CONTINUE:
- case DO:
- case DOUBLE:
- case FALSE:
- case FINAL:
- case FLOAT:
- case FOR:
- case IF:
- case INT:
- case INTERFACE:
- case LONG:
- case NEW:
- case NULL:
- case RETURN:
- case SHORT:
- case SUPER:
- case SWITCH:
- case SYNCHRONIZED:
- case THIS:
- case THROW:
- case TRUE:
- case TRY:
- case VOID:
- case WHILE:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case LBRACE:
- case SEMICOLON:
- case INCR:
- case DECR:
- ;
- break;
- default:
- break label_41;
- }
- BlockStatement(switchBlockInterne);
- }
- // on y colle le foutoir...
- switchBlockElem.addChild(switchBlockInterne);
- }
- jj_consume_token(RBRACE);
- {if (true) return switchElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement SwitchLabel() throws ParseException {
- IXMLElement caseElem = new XMLElement();
- IXMLElement temp;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case CASE:
- jj_consume_token(CASE);
- temp = Expression();
- jj_consume_token(COLON);
- caseElem.setName("case");
- caseElem.addChild(temp);
- System.out.println(temp.getAttributeCount());
- break;
- case _DEFAULT:
- jj_consume_token(_DEFAULT);
- jj_consume_token(COLON);
- caseElem.setName("default-case");
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- {if (true) return caseElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- *<!ELEMENT if (test,true-case,false-case?)>
- */
- final public IXMLElement IfStatement() throws ParseException {
- IXMLElement ifElem = new XMLElement();
- IXMLElement temp;
- ifElem.setName("if");
- jj_consume_token(IF);
- jj_consume_token(LPAREN);
- temp = Expression();
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp);
- ifElem.addChild(testElem);
- jj_consume_token(RPAREN);
- temp = Statement();
- IXMLElement trueElem = new XMLElement();
- trueElem.setName("true-case");
- trueElem.addChild(temp);
- ifElem.addChild(trueElem);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ELSE:
- jj_consume_token(ELSE);
- temp = Statement();
- IXMLElement falseElem = new XMLElement();
- falseElem.setName("false-case");
- falseElem.addChild(temp);
- ifElem.addChild(falseElem);
- break;
- default:
- ;
- }
- {if (true) return ifElem;}
- throw new Error("Missing return statement in function");
- }
-
-/**
- *<!ELEMENT loop (init*,test?,update*,(%stmt-elems;)?)>
- * <!ATTLIST loop
- * kind (for|while|do) #REQUIRED
- * %location-info;>
- *<!ELEMENT init (local-variable|%expr-elems;)*>
- *<!ELEMENT update (%expr-elems;)>
- *
- *
- */
- final public IXMLElement WhileStatement() throws ParseException {
- IXMLElement loopElem = new XMLElement();
- loopElem.setName("loop");
- loopElem.setAttribute("kind","while");
- IXMLElement temp;
- jj_consume_token(WHILE);
- jj_consume_token(LPAREN);
- temp = Expression();
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp);
- loopElem.addChild(testElem);
- jj_consume_token(RPAREN);
- temp = Statement();
- loopElem.addChild(temp);
- {if (true) return loopElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement DoStatement() throws ParseException {
- IXMLElement loopElem = new XMLElement();
- loopElem.setName("loop");
- loopElem.setAttribute("kind","do");
- IXMLElement temp1;
- IXMLElement temp2;
- jj_consume_token(DO);
- temp1 = Statement();
- jj_consume_token(WHILE);
- jj_consume_token(LPAREN);
- temp2 = Expression();
- jj_consume_token(RPAREN);
- jj_consume_token(SEMICOLON);
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp2);
- loopElem.addChild(testElem);
- loopElem.addChild(temp1);
- {if (true) return loopElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ForStatement() throws ParseException {
- IXMLElement loopElem = new XMLElement();
- loopElem.setName("loop");
- loopElem.setAttribute("kind","for");
- IXMLElement temp;
- jj_consume_token(FOR);
- jj_consume_token(LPAREN);
- if (jj_2_35(2147483647)) {
- Type();
- jj_consume_token(IDENTIFIER);
- jj_consume_token(COLON);
- Expression();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FINAL:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case SEMICOLON:
- case INCR:
- case DECR:
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FINAL:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case INCR:
- case DECR:
- temp = ForInit();
- loopElem.addChild(temp);
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- temp = Expression();
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp);
- loopElem.addChild(testElem);
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case INCR:
- case DECR:
- temp = ForUpdate();
- loopElem.addChild(temp);
- break;
- default:
- ;
- }
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- jj_consume_token(RPAREN);
- temp = Statement();
- loopElem.addChild(temp);
- {if (true) return loopElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public IXMLElement ForInit() throws ParseException {
- IXMLElement initElem = new XMLElement();
- initElem.setName("init");
- if (jj_2_36(2147483647)) {
- LocalVariableDeclaration(initElem);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case INCR:
- case DECR:
- StatementExpressionList(initElem);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- {if (true) return initElem;}
- throw new Error("Missing return statement in function");
- }
-
- final public void StatementExpressionList(IXMLElement element) throws ParseException {
- IXMLElement temp;
- temp = StatementExpression();
- element.addChild(temp);
- label_42:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_42;
- }
- jj_consume_token(COMMA);
- temp = StatementExpression();
- element.addChild(temp);
- }
- }
-
- final public IXMLElement ForUpdate() throws ParseException {
- IXMLElement updateElem = new XMLElement();
- updateElem.setName("update");
- StatementExpressionList(updateElem);
- {if (true) return updateElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
-<!ELEMENT break EMPTY>
-<!ATTLIST break
- targetname CDATA #IMPLIED>
- */
- final public IXMLElement BreakStatement() throws ParseException {
- IXMLElement breakElem = new XMLElement();
- breakElem.setName("break");
- Token t;
- jj_consume_token(BREAK);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER:
- t = jj_consume_token(IDENTIFIER);
- breakElem.setAttribute("targetname",t.image);
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- {if (true) return breakElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
-<!ELEMENT continue EMPTY>
-<!ATTLIST continue
- targetname CDATA #IMPLIED>
-*/
- final public IXMLElement ContinueStatement() throws ParseException {
- IXMLElement continueElem = new XMLElement();
- continueElem.setName("continue");
- Token t;
- jj_consume_token(CONTINUE);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER:
- t = jj_consume_token(IDENTIFIER);
- continueElem.setAttribute("targetname",t.image);
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- {if (true) return continueElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
-<!ELEMENT return (%expr-elems;)?>
-*/
- final public IXMLElement ReturnStatement() throws ParseException {
- IXMLElement returnElem = new XMLElement();
- returnElem.setName("return");
- IXMLElement exprElem;
- jj_consume_token(RETURN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- exprElem = Expression();
- returnElem.addChild(exprElem);
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- {if (true) return returnElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
-<!ELEMENT throw (%expr-elems;)>
- */
- final public IXMLElement ThrowStatement() throws ParseException {
- IXMLElement throwElem = new XMLElement();
- throwElem.setName("throw");
- IXMLElement exprElem;
- jj_consume_token(THROW);
- exprElem = Expression();
- jj_consume_token(SEMICOLON);
- throwElem.addChild(exprElem);
- {if (true) return throwElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
- <!ELEMENT synchronized (expr,block)>
-<!ELEMENT expr (%expr-elems;)>
- */
- final public IXMLElement SynchronizedStatement() throws ParseException {
- IXMLElement syncElem = new XMLElement();
- syncElem.setName("synchronized");
- IXMLElement temp;
- jj_consume_token(SYNCHRONIZED);
- jj_consume_token(LPAREN);
- temp = Expression();
- IXMLElement exprElem = new XMLElement();
- exprElem.setName("expr");
- exprElem.addChild(temp);
- syncElem.addChild(exprElem);
- jj_consume_token(RPAREN);
- temp = Block();
- syncElem.addChild(temp);
- {if (true) return syncElem;}
- throw new Error("Missing return statement in function");
- }
-
-/*
-<!ELEMENT try ((%stmt-elems;),catch*,finally?)>
-<!ELEMENT catch (formal-argument,(%stmt-elems;)?)>
-<!ELEMENT finally (%stmt-elems;)>
-*/
- final public IXMLElement TryStatement() throws ParseException {
- IXMLElement tryElem = new XMLElement();
- tryElem.setName("try");
- IXMLElement temp;
- jj_consume_token(TRY);
- temp = Block();
- tryElem.addChild(temp);
- label_43:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case CATCH:
- ;
- break;
- default:
- break label_43;
- }
- IXMLElement catchElem = new XMLElement();
- catchElem.setName("catch");
- jj_consume_token(CATCH);
- jj_consume_token(LPAREN);
- temp = FormalParameter();
- catchElem.addChild(temp);
- jj_consume_token(RPAREN);
- temp = Block();
- catchElem.addChild(temp);
- tryElem.addChild(catchElem);
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case FINALLY:
- IXMLElement finallyElem = new XMLElement();
- finallyElem.setName("finally");
- jj_consume_token(FINALLY);
- temp = Block();
- finallyElem.addChild(temp);
- tryElem.addChild(finallyElem);
- break;
- default:
- ;
- }
- if (tryElem.getChildrenCount()==0)
- {if (true) throw new ParseException("try should end with atleast one catch or one finally");}
- {if (true) return tryElem;}
- throw new Error("Missing return statement in function");
- }
-
-/* We use productions to match >>>, >> and > so that we can keep the
- * type declaration syntax with generics clean
- */
- final public String RUNSIGNEDSHIFT() throws ParseException {
- if (getToken(1).kind == GT &&
- ((Token.GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT) {
-
- } else {
- jj_consume_token(-1);
- throw new ParseException();
- }
- jj_consume_token(GT);
- jj_consume_token(GT);
- jj_consume_token(GT);
- {if (true) return ">>>";}
- throw new Error("Missing return statement in function");
- }
-
- final public String RSIGNEDSHIFT() throws ParseException {
- if (getToken(1).kind == GT &&
- ((Token.GTToken)getToken(1)).realKind == RSIGNEDSHIFT) {
-
- } else {
- jj_consume_token(-1);
- throw new ParseException();
- }
- jj_consume_token(GT);
- jj_consume_token(GT);
- {if (true) return ">>";}
- throw new Error("Missing return statement in function");
- }
-
-/* Annotation syntax follows. */
- final public void Annotation() throws ParseException {
- if (jj_2_37(2147483647)) {
- NormalAnnotation();
- } else if (jj_2_38(2147483647)) {
- SingleMemberAnnotation();
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case AT:
- MarkerAnnotation();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- }
-
- final public void NormalAnnotation() throws ParseException {
- jj_consume_token(AT);
- Name();
- jj_consume_token(LPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case IDENTIFIER:
- MemberValuePairs();
- break;
- default:
- ;
- }
- jj_consume_token(RPAREN);
- }
-
- final public void MarkerAnnotation() throws ParseException {
- jj_consume_token(AT);
- Name();
- }
-
- final public void SingleMemberAnnotation() throws ParseException {
- jj_consume_token(AT);
- Name();
- jj_consume_token(LPAREN);
- MemberValue();
- jj_consume_token(RPAREN);
- }
-
- final public void MemberValuePairs() throws ParseException {
- MemberValuePair();
- label_44:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- ;
- break;
- default:
- break label_44;
- }
- jj_consume_token(COMMA);
- MemberValuePair();
- }
- }
-
- final public void MemberValuePair() throws ParseException {
- jj_consume_token(IDENTIFIER);
- jj_consume_token(ASSIGN);
- MemberValue();
- }
-
- final public void MemberValue() throws ParseException {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case AT:
- Annotation();
- break;
- case LBRACE:
- MemberValueArrayInitializer();
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FALSE:
- case FLOAT:
- case INT:
- case LONG:
- case NEW:
- case NULL:
- case SHORT:
- case SUPER:
- case THIS:
- case TRUE:
- case VOID:
- case INTEGER_LITERAL:
- case FLOATING_POINT_LITERAL:
- case CHARACTER_LITERAL:
- case STRING_LITERAL:
- case IDENTIFIER:
- case LPAREN:
- case BANG:
- case TILDE:
- case INCR:
- case DECR:
- case PLUS:
- case MINUS:
- ConditionalExpression();
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
-
- final public void MemberValueArrayInitializer() throws ParseException {
- jj_consume_token(LBRACE);
- MemberValue();
- label_45:
- while (true) {
- if (jj_2_39(2)) {
- ;
- } else {
- break label_45;
- }
- jj_consume_token(COMMA);
- MemberValue();
- }
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case COMMA:
- jj_consume_token(COMMA);
- break;
- default:
- ;
- }
- jj_consume_token(RBRACE);
- }
-
-/*
- *
- *
- */
-/* Annotation Types. */
- final public void AnnotationTypeDeclaration(int modifiers) throws ParseException {
- jj_consume_token(AT);
- jj_consume_token(INTERFACE);
- jj_consume_token(IDENTIFIER);
- AnnotationTypeBody();
- }
-
- final public void AnnotationTypeBody() throws ParseException {
- jj_consume_token(LBRACE);
- label_46:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ABSTRACT:
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case CLASS:
- case DOUBLE:
- case ENUM:
- case FINAL:
- case FLOAT:
- case INT:
- case INTERFACE:
- case LONG:
- case NATIVE:
- case PRIVATE:
- case PROTECTED:
- case PUBLIC:
- case SHORT:
- case STATIC:
- case STRICTFP:
- case SYNCHRONIZED:
- case TRANSIENT:
- case VOLATILE:
- case IDENTIFIER:
- case SEMICOLON:
- case AT:
- ;
- break;
- default:
- break label_46;
- }
- AnnotationTypeMemberDeclaration();
- }
- jj_consume_token(RBRACE);
- }
-
- final public void AnnotationTypeMemberDeclaration() throws ParseException {
- int modifiers;
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case ABSTRACT:
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case CLASS:
- case DOUBLE:
- case ENUM:
- case FINAL:
- case FLOAT:
- case INT:
- case INTERFACE:
- case LONG:
- case NATIVE:
- case PRIVATE:
- case PROTECTED:
- case PUBLIC:
- case SHORT:
- case STATIC:
- case STRICTFP:
- case SYNCHRONIZED:
- case TRANSIENT:
- case VOLATILE:
- case IDENTIFIER:
- case AT:
- modifiers = Modifiers();
- if (jj_2_40(2147483647)) {
- Type();
- jj_consume_token(IDENTIFIER);
- jj_consume_token(LPAREN);
- jj_consume_token(RPAREN);
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case _DEFAULT:
- DefaultValue();
- break;
- default:
- ;
- }
- jj_consume_token(SEMICOLON);
- } else {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case CLASS:
- case INTERFACE:
- ClassOrInterfaceDeclaration(modifiers);
- break;
- case ENUM:
- EnumDeclaration(modifiers);
- break;
- case AT:
- AnnotationTypeDeclaration(modifiers);
- break;
- case BOOLEAN:
- case BYTE:
- case CHAR:
- case DOUBLE:
- case FLOAT:
- case INT:
- case LONG:
- case SHORT:
- case IDENTIFIER:
- FieldDeclaration(modifiers,null);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
- break;
- case SEMICOLON:
- jj_consume_token(SEMICOLON);
- break;
- default:
- jj_consume_token(-1);
- throw new ParseException();
- }
- }
-
- final public void DefaultValue() throws ParseException {
- jj_consume_token(_DEFAULT);
- MemberValue();
- }
-
- private boolean jj_2_1(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_1(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_2(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_2(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_3(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_3(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_4(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_4(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_5(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_5(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_6(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_6(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_7(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_7(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_8(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_8(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_9(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_9(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_10(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_10(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_11(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_11(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_12(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_12(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_13(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_13(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_14(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_14(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_15(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_15(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_16(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_16(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_17(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_17(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_18(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_18(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_19(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_19(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_20(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_20(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_21(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_21(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_22(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_22(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_23(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_23(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_24(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_24(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_25(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_25(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_26(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_26(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_27(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_27(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_28(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_28(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_29(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_29(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_30(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_30(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_31(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_31(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_32(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_32(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_33(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_33(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_34(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_34(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_35(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_35(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_36(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_36(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_37(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_37(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_38(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_38(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_39(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_39(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_2_40(int xla) {
- jj_la = xla; jj_lastpos = jj_scanpos = token;
- try { return !jj_3_40(); }
- catch(LookaheadSuccess ls) { return true; }
- }
-
- private boolean jj_3R_198() {
- if (jj_scan_token(FALSE)) return true;
- return false;
- }
-
- private boolean jj_3R_316() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_147()) return true;
- return false;
- }
-
- private boolean jj_3R_176() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_197()) {
- jj_scanpos = xsp;
- if (jj_3R_198()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_197() {
- if (jj_scan_token(TRUE)) return true;
- return false;
- }
-
- private boolean jj_3R_299() {
- if (jj_scan_token(IMPLEMENTS)) return true;
- if (jj_3R_147()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_316()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_127() {
- if (jj_3R_60()) return true;
- return false;
- }
-
- private boolean jj_3R_170() {
- if (jj_scan_token(45)) return true;
- return false;
- }
-
- private boolean jj_3R_126() {
- if (jj_scan_token(VOID)) return true;
- return false;
- }
-
- private boolean jj_3R_77() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_126()) {
- jj_scanpos = xsp;
- if (jj_3R_127()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_214() {
- if (jj_scan_token(SYNCHRONIZED)) return true;
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_3R_88()) return true;
- return false;
- }
-
- private boolean jj_3R_169() {
- if (jj_3R_176()) return true;
- return false;
- }
-
- private boolean jj_3R_168() {
- if (jj_scan_token(STRING_LITERAL)) return true;
- return false;
- }
-
- private boolean jj_3R_315() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_147()) return true;
- return false;
- }
-
- private boolean jj_3R_122() {
- if (jj_scan_token(DOUBLE)) return true;
- return false;
- }
-
- private boolean jj_3R_167() {
- if (jj_scan_token(CHARACTER_LITERAL)) return true;
- return false;
- }
-
- private boolean jj_3R_213() {
- if (jj_scan_token(THROW)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_121() {
- if (jj_scan_token(FLOAT)) return true;
- return false;
- }
-
- private boolean jj_3R_166() {
- if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
- return false;
- }
-
- private boolean jj_3R_338() {
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_120() {
- if (jj_scan_token(LONG)) return true;
- return false;
- }
-
- private boolean jj_3R_298() {
- if (jj_scan_token(EXTENDS)) return true;
- if (jj_3R_147()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_315()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_158() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_165()) {
- jj_scanpos = xsp;
- if (jj_3R_166()) {
- jj_scanpos = xsp;
- if (jj_3R_167()) {
- jj_scanpos = xsp;
- if (jj_3R_168()) {
- jj_scanpos = xsp;
- if (jj_3R_169()) {
- jj_scanpos = xsp;
- if (jj_3R_170()) return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_165() {
- if (jj_scan_token(INTEGER_LITERAL)) return true;
- return false;
- }
-
- private boolean jj_3R_119() {
- if (jj_scan_token(INT)) return true;
- return false;
- }
-
- private boolean jj_3R_212() {
- if (jj_scan_token(RETURN)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_338()) jj_scanpos = xsp;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_118() {
- if (jj_scan_token(SHORT)) return true;
- return false;
- }
-
- private boolean jj_3R_337() {
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_117() {
- if (jj_scan_token(BYTE)) return true;
- return false;
- }
-
- private boolean jj_3R_116() {
- if (jj_scan_token(CHAR)) return true;
- return false;
- }
-
- private boolean jj_3R_278() {
- if (jj_3R_299()) return true;
- return false;
- }
-
- private boolean jj_3R_277() {
- if (jj_3R_298()) return true;
- return false;
- }
-
- private boolean jj_3R_75() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_115()) {
- jj_scanpos = xsp;
- if (jj_3R_116()) {
- jj_scanpos = xsp;
- if (jj_3R_117()) {
- jj_scanpos = xsp;
- if (jj_3R_118()) {
- jj_scanpos = xsp;
- if (jj_3R_119()) {
- jj_scanpos = xsp;
- if (jj_3R_120()) {
- jj_scanpos = xsp;
- if (jj_3R_121()) {
- jj_scanpos = xsp;
- if (jj_3R_122()) return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_115() {
- if (jj_scan_token(BOOLEAN)) return true;
- return false;
- }
-
- private boolean jj_3R_276() {
- if (jj_3R_85()) return true;
- return false;
- }
-
- private boolean jj_3R_211() {
- if (jj_scan_token(CONTINUE)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_337()) jj_scanpos = xsp;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_336() {
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_196() {
- if (jj_scan_token(INTERFACE)) return true;
- return false;
- }
-
- private boolean jj_3R_195() {
- if (jj_scan_token(CLASS)) return true;
- return false;
- }
-
- private boolean jj_3R_210() {
- if (jj_scan_token(BREAK)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_336()) jj_scanpos = xsp;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_175() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_195()) {
- jj_scanpos = xsp;
- if (jj_3R_196()) return true;
- }
- if (jj_scan_token(IDENTIFIER)) return true;
- xsp = jj_scanpos;
- if (jj_3R_276()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_277()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_278()) jj_scanpos = xsp;
- if (jj_3R_236()) return true;
- return false;
- }
-
- private boolean jj_3R_240() {
- if (jj_scan_token(SUPER)) return true;
- if (jj_3R_67()) return true;
- return false;
- }
-
- private boolean jj_3R_234() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_239()) {
- jj_scanpos = xsp;
- if (jj_3R_240()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_239() {
- if (jj_scan_token(EXTENDS)) return true;
- if (jj_3R_67()) return true;
- return false;
- }
-
- private boolean jj_3R_125() {
- if (jj_3R_66()) return true;
- return false;
- }
-
- private boolean jj_3R_124() {
- if (jj_scan_token(DOT)) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_357() {
- if (jj_3R_360()) return true;
- return false;
- }
-
- private boolean jj_3R_361() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_204()) return true;
- return false;
- }
-
- private boolean jj_3R_123() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_227() {
- if (jj_3R_234()) return true;
- return false;
- }
-
- private boolean jj_3_28() {
- if (jj_3R_79()) return true;
- return false;
- }
-
- private boolean jj_3R_360() {
- if (jj_3R_204()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_361()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_149() {
- if (jj_scan_token(HOOK)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_227()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3_36() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(31)) jj_scanpos = xsp;
- if (jj_3R_60()) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_148() {
- if (jj_3R_67()) return true;
- return false;
- }
-
- private boolean jj_3R_97() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_148()) {
- jj_scanpos = xsp;
- if (jj_3R_149()) return true;
- }
- return false;
- }
-
- private boolean jj_3_27() {
- if (jj_scan_token(DOT)) return true;
- if (jj_3R_78()) return true;
- return false;
- }
-
- private boolean jj_3R_58() {
- if (jj_3R_84()) return true;
- return false;
- }
-
- private boolean jj_3R_359() {
- if (jj_3R_360()) return true;
- return false;
- }
-
- private boolean jj_3R_57() {
- if (jj_scan_token(STRICTFP)) return true;
- return false;
- }
-
- private boolean jj_3R_356() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_358()) {
- jj_scanpos = xsp;
- if (jj_3R_359()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_358() {
- if (jj_3R_173()) return true;
- return false;
- }
-
- private boolean jj_3R_56() {
- if (jj_scan_token(VOLATILE)) return true;
- return false;
- }
-
- private boolean jj_3_26() {
- if (jj_scan_token(DOT)) return true;
- if (jj_scan_token(THIS)) return true;
- return false;
- }
-
- private boolean jj_3R_76() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_26()) {
- jj_scanpos = xsp;
- if (jj_3_27()) {
- jj_scanpos = xsp;
- if (jj_3_28()) {
- jj_scanpos = xsp;
- if (jj_3R_123()) {
- jj_scanpos = xsp;
- if (jj_3R_124()) {
- jj_scanpos = xsp;
- if (jj_3R_125()) return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_55() {
- if (jj_scan_token(TRANSIENT)) return true;
- return false;
- }
-
- private boolean jj_3R_54() {
- if (jj_scan_token(NATIVE)) return true;
- return false;
- }
-
- private boolean jj_3R_53() {
- if (jj_scan_token(SYNCHRONIZED)) return true;
- return false;
- }
-
- private boolean jj_3R_52() {
- if (jj_scan_token(ABSTRACT)) return true;
- return false;
- }
-
- private boolean jj_3R_350() {
- if (jj_3R_357()) return true;
- return false;
- }
-
- private boolean jj_3R_51() {
- if (jj_scan_token(FINAL)) return true;
- return false;
- }
-
- private boolean jj_3R_50() {
- if (jj_scan_token(PRIVATE)) return true;
- return false;
- }
-
- private boolean jj_3R_201() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_97()) return true;
- return false;
- }
-
- private boolean jj_3R_49() {
- if (jj_scan_token(PROTECTED)) return true;
- return false;
- }
-
- private boolean jj_3R_48() {
- if (jj_scan_token(STATIC)) return true;
- return false;
- }
-
- private boolean jj_3_35() {
- if (jj_3R_60()) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(COLON)) return true;
- return false;
- }
-
- private boolean jj_3R_47() {
- if (jj_scan_token(PUBLIC)) return true;
- return false;
- }
-
- private boolean jj_3_11() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_68() {
- if (jj_scan_token(LT)) return true;
- if (jj_3R_97()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_201()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(GT)) return true;
- return false;
- }
-
- private boolean jj_3R_349() {
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3_25() {
- if (jj_3R_77()) return true;
- if (jj_scan_token(DOT)) return true;
- if (jj_scan_token(CLASS)) return true;
- return false;
- }
-
- private boolean jj_3R_145() {
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3_1() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_47()) {
- jj_scanpos = xsp;
- if (jj_3R_48()) {
- jj_scanpos = xsp;
- if (jj_3R_49()) {
- jj_scanpos = xsp;
- if (jj_3R_50()) {
- jj_scanpos = xsp;
- if (jj_3R_51()) {
- jj_scanpos = xsp;
- if (jj_3R_52()) {
- jj_scanpos = xsp;
- if (jj_3R_53()) {
- jj_scanpos = xsp;
- if (jj_3R_54()) {
- jj_scanpos = xsp;
- if (jj_3R_55()) {
- jj_scanpos = xsp;
- if (jj_3R_56()) {
- jj_scanpos = xsp;
- if (jj_3R_57()) {
- jj_scanpos = xsp;
- if (jj_3R_58()) return true;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_348() {
- if (jj_3R_356()) return true;
- return false;
- }
-
- private boolean jj_3R_254() {
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_1()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_335() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_348()) jj_scanpos = xsp;
- if (jj_scan_token(SEMICOLON)) return true;
- xsp = jj_scanpos;
- if (jj_3R_349()) jj_scanpos = xsp;
- if (jj_scan_token(SEMICOLON)) return true;
- xsp = jj_scanpos;
- if (jj_3R_350()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_334() {
- if (jj_3R_60()) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(COLON)) return true;
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_144() {
- if (jj_3R_77()) return true;
- if (jj_scan_token(DOT)) return true;
- if (jj_scan_token(CLASS)) return true;
- return false;
- }
-
- private boolean jj_3_10() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_143() {
- if (jj_3R_78()) return true;
- return false;
- }
-
- private boolean jj_3R_209() {
- if (jj_scan_token(FOR)) return true;
- if (jj_scan_token(LPAREN)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_334()) {
- jj_scanpos = xsp;
- if (jj_3R_335()) return true;
- }
- if (jj_scan_token(RPAREN)) return true;
- if (jj_3R_174()) return true;
- return false;
- }
-
- private boolean jj_3_14() {
- if (jj_3R_68()) return true;
- return false;
- }
-
- private boolean jj_3_13() {
- if (jj_scan_token(DOT)) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_14()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3_12() {
- if (jj_3R_68()) return true;
- return false;
- }
-
- private boolean jj_3R_142() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_147() {
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_12()) jj_scanpos = xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_13()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3_24() {
- if (jj_3R_76()) return true;
- return false;
- }
-
- private boolean jj_3R_141() {
- if (jj_scan_token(SUPER)) return true;
- if (jj_scan_token(DOT)) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_208() {
- if (jj_scan_token(DO)) return true;
- if (jj_3R_174()) return true;
- if (jj_scan_token(WHILE)) return true;
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_140() {
- if (jj_scan_token(THIS)) return true;
- return false;
- }
-
- private boolean jj_3R_93() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_139()) {
- jj_scanpos = xsp;
- if (jj_3R_140()) {
- jj_scanpos = xsp;
- if (jj_3R_141()) {
- jj_scanpos = xsp;
- if (jj_3R_142()) {
- jj_scanpos = xsp;
- if (jj_3R_143()) {
- jj_scanpos = xsp;
- if (jj_3R_144()) {
- jj_scanpos = xsp;
- if (jj_3R_145()) return true;
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_139() {
- if (jj_3R_158()) return true;
- return false;
- }
-
- private boolean jj_3R_96() {
- if (jj_3R_147()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_11()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_95() {
- if (jj_3R_75()) return true;
- Token xsp;
- if (jj_3_10()) return true;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_10()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_67() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_95()) {
- jj_scanpos = xsp;
- if (jj_3R_96()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_151() {
- if (jj_3R_158()) return true;
- return false;
- }
-
- private boolean jj_3R_344() {
- if (jj_scan_token(DECR)) return true;
- return false;
- }
-
- private boolean jj_3R_79() {
- if (jj_scan_token(DOT)) return true;
- if (jj_3R_68()) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_86() {
- if (jj_3R_75()) return true;
- return false;
- }
-
- private boolean jj_3_9() {
- if (jj_3R_67()) return true;
- return false;
- }
-
- private boolean jj_3R_207() {
- if (jj_scan_token(WHILE)) return true;
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_3R_174()) return true;
- return false;
- }
-
- private boolean jj_3R_65() {
- if (jj_3R_93()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_24()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_60() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_9()) {
- jj_scanpos = xsp;
- if (jj_3R_86()) return true;
- }
- return false;
- }
-
- private boolean jj_3_23() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_75()) return true;
- return false;
- }
-
- private boolean jj_3R_325() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_60()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_3R_275()) return true;
- return false;
- }
-
- private boolean jj_3R_324() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_60()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_3R_253()) return true;
- return false;
- }
-
- private boolean jj_3R_343() {
- if (jj_scan_token(INCR)) return true;
- return false;
- }
-
- private boolean jj_3R_330() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_343()) {
- jj_scanpos = xsp;
- if (jj_3R_344()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_313() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_324()) {
- jj_scanpos = xsp;
- if (jj_3R_325()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_87() {
- if (jj_scan_token(STATIC)) return true;
- return false;
- }
-
- private boolean jj_3R_333() {
- if (jj_scan_token(ELSE)) return true;
- if (jj_3R_174()) return true;
- return false;
- }
-
- private boolean jj_3R_62() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_87()) jj_scanpos = xsp;
- if (jj_3R_88()) return true;
- return false;
- }
-
- private boolean jj_3R_206() {
- if (jj_scan_token(IF)) return true;
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_3R_174()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_333()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3_8() {
- if (jj_scan_token(THIS)) return true;
- if (jj_3R_66()) return true;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_314() {
- if (jj_3R_65()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_330()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3_7() {
- if (jj_3R_65()) return true;
- if (jj_scan_token(DOT)) return true;
- return false;
- }
-
- private boolean jj_3R_92() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_7()) jj_scanpos = xsp;
- if (jj_scan_token(SUPER)) return true;
- if (jj_3R_66()) return true;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_64() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_91()) {
- jj_scanpos = xsp;
- if (jj_3R_92()) return true;
- }
- return false;
- }
-
- private boolean jj_3_22() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_60()) return true;
- if (jj_scan_token(LBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_91() {
- if (jj_scan_token(THIS)) return true;
- if (jj_3R_66()) return true;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3_6() {
- if (jj_3R_64()) return true;
- return false;
- }
-
- private boolean jj_3R_114() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_60()) return true;
- if (jj_scan_token(RPAREN)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(90)) {
- jj_scanpos = xsp;
- if (jj_scan_token(89)) {
- jj_scanpos = xsp;
- if (jj_scan_token(77)) {
- jj_scanpos = xsp;
- if (jj_scan_token(74)) {
- jj_scanpos = xsp;
- if (jj_scan_token(57)) {
- jj_scanpos = xsp;
- if (jj_scan_token(54)) {
- jj_scanpos = xsp;
- if (jj_scan_token(44)) {
- jj_scanpos = xsp;
- if (jj_3R_151()) return true;
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_113() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_60()) return true;
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_285() {
- if (jj_3R_157()) return true;
- return false;
- }
-
- private boolean jj_3R_284() {
- if (jj_3R_64()) return true;
- return false;
- }
-
- private boolean jj_3_21() {
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_75()) return true;
- return false;
- }
-
- private boolean jj_3R_74() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_21()) {
- jj_scanpos = xsp;
- if (jj_3R_113()) {
- jj_scanpos = xsp;
- if (jj_3R_114()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_355() {
- if (jj_scan_token(_DEFAULT)) return true;
- if (jj_scan_token(COLON)) return true;
- return false;
- }
-
- private boolean jj_3_20() {
- if (jj_3R_74()) return true;
- return false;
- }
-
- private boolean jj_3R_312() {
- if (jj_scan_token(BANG)) return true;
- return false;
- }
-
- private boolean jj_3R_346() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_354()) {
- jj_scanpos = xsp;
- if (jj_3R_355()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_354() {
- if (jj_scan_token(CASE)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(COLON)) return true;
- return false;
- }
-
- private boolean jj_3R_297() {
- if (jj_3R_314()) return true;
- return false;
- }
-
- private boolean jj_3R_296() {
- if (jj_3R_313()) return true;
- return false;
- }
-
- private boolean jj_3R_347() {
- if (jj_3R_157()) return true;
- return false;
- }
-
- private boolean jj_3R_283() {
- if (jj_scan_token(THROWS)) return true;
- if (jj_3R_304()) return true;
- return false;
- }
-
- private boolean jj_3R_311() {
- if (jj_scan_token(TILDE)) return true;
- return false;
- }
-
- private boolean jj_3R_275() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_295()) {
- jj_scanpos = xsp;
- if (jj_3R_296()) {
- jj_scanpos = xsp;
- if (jj_3R_297()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_295() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_311()) {
- jj_scanpos = xsp;
- if (jj_3R_312()) return true;
- }
- if (jj_3R_253()) return true;
- return false;
- }
-
- private boolean jj_3R_321() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_320()) return true;
- return false;
- }
-
- private boolean jj_3R_281() {
- if (jj_3R_85()) return true;
- return false;
- }
-
- private boolean jj_3R_269() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_281()) jj_scanpos = xsp;
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_3R_282()) return true;
- xsp = jj_scanpos;
- if (jj_3R_283()) jj_scanpos = xsp;
- if (jj_scan_token(LBRACE)) return true;
- xsp = jj_scanpos;
- if (jj_3R_284()) jj_scanpos = xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_285()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(RBRACE)) return true;
- return false;
- }
-
- private boolean jj_3R_332() {
- if (jj_3R_346()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_347()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_229() {
- if (jj_scan_token(DECR)) return true;
- if (jj_3R_65()) return true;
- return false;
- }
-
- private boolean jj_3R_310() {
- if (jj_scan_token(REM)) return true;
- return false;
- }
-
- private boolean jj_3R_228() {
- if (jj_scan_token(INCR)) return true;
- if (jj_3R_65()) return true;
- return false;
- }
-
- private boolean jj_3R_205() {
- if (jj_scan_token(SWITCH)) return true;
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_scan_token(LBRACE)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_332()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(RBRACE)) return true;
- return false;
- }
-
- private boolean jj_3R_326() {
- if (jj_scan_token(FINAL)) return true;
- return false;
- }
-
- private boolean jj_3R_320() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_326()) jj_scanpos = xsp;
- if (jj_3R_60()) return true;
- xsp = jj_scanpos;
- if (jj_scan_token(121)) jj_scanpos = xsp;
- if (jj_3R_305()) return true;
- return false;
- }
-
- private boolean jj_3R_274() {
- if (jj_scan_token(MINUS)) return true;
- return false;
- }
-
- private boolean jj_3_19() {
- if (jj_3R_73()) return true;
- return false;
- }
-
- private boolean jj_3R_267() {
- if (jj_3R_275()) return true;
- return false;
- }
-
- private boolean jj_3R_266() {
- if (jj_3R_229()) return true;
- return false;
- }
-
- private boolean jj_3R_309() {
- if (jj_scan_token(SLASH)) return true;
- return false;
- }
-
- private boolean jj_3R_265() {
- if (jj_3R_228()) return true;
- return false;
- }
-
- private boolean jj_3R_303() {
- if (jj_3R_320()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_321()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_273() {
- if (jj_scan_token(PLUS)) return true;
- return false;
- }
-
- private boolean jj_3R_253() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_264()) {
- jj_scanpos = xsp;
- if (jj_3R_265()) {
- jj_scanpos = xsp;
- if (jj_3R_266()) {
- jj_scanpos = xsp;
- if (jj_3R_267()) return true;
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_264() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_273()) {
- jj_scanpos = xsp;
- if (jj_3R_274()) return true;
- }
- if (jj_3R_253()) return true;
- return false;
- }
-
- private boolean jj_3R_263() {
- if (jj_scan_token(GE)) return true;
- return false;
- }
-
- private boolean jj_3R_282() {
- if (jj_scan_token(LPAREN)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_303()) jj_scanpos = xsp;
- if (jj_scan_token(RPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_353() {
- if (jj_3R_69()) return true;
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_352() {
- if (jj_scan_token(DECR)) return true;
- return false;
- }
-
- private boolean jj_3R_294() {
- if (jj_scan_token(MINUS)) return true;
- return false;
- }
-
- private boolean jj_3R_308() {
- if (jj_scan_token(STAR)) return true;
- return false;
- }
-
- private boolean jj_3R_292() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_308()) {
- jj_scanpos = xsp;
- if (jj_3R_309()) {
- jj_scanpos = xsp;
- if (jj_3R_310()) return true;
- }
- }
- if (jj_3R_253()) return true;
- return false;
- }
-
- private boolean jj_3R_351() {
- if (jj_scan_token(INCR)) return true;
- return false;
- }
-
- private boolean jj_3R_345() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_351()) {
- jj_scanpos = xsp;
- if (jj_3R_352()) {
- jj_scanpos = xsp;
- if (jj_3R_353()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_307() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_220() {
- if (jj_3R_65()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_345()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_249() {
- if (jj_3R_253()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_292()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_289() {
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_3R_282()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_307()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_219() {
- if (jj_3R_229()) return true;
- return false;
- }
-
- private boolean jj_3R_204() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_218()) {
- jj_scanpos = xsp;
- if (jj_3R_219()) {
- jj_scanpos = xsp;
- if (jj_3R_220()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_218() {
- if (jj_3R_228()) return true;
- return false;
- }
-
- private boolean jj_3R_262() {
- if (jj_scan_token(LE)) return true;
- return false;
- }
-
- private boolean jj_3_18() {
- if (jj_3R_72()) return true;
- return false;
- }
-
- private boolean jj_3R_293() {
- if (jj_scan_token(PLUS)) return true;
- return false;
- }
-
- private boolean jj_3R_291() {
- if (jj_3R_88()) return true;
- return false;
- }
-
- private boolean jj_3R_272() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_293()) {
- jj_scanpos = xsp;
- if (jj_3R_294()) return true;
- }
- if (jj_3R_249()) return true;
- return false;
- }
-
- private boolean jj_3R_244() {
- if (jj_3R_249()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_272()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_203() {
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_261() {
- if (jj_scan_token(GT)) return true;
- return false;
- }
-
- private boolean jj_3R_290() {
- if (jj_scan_token(THROWS)) return true;
- if (jj_3R_304()) return true;
- return false;
- }
-
- private boolean jj_3R_71() {
- if (jj_scan_token(LSHIFT)) return true;
- return false;
- }
-
- private boolean jj_3_17() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_71()) {
- jj_scanpos = xsp;
- if (jj_3_18()) {
- jj_scanpos = xsp;
- if (jj_3_19()) return true;
- }
- }
- if (jj_3R_244()) return true;
- return false;
- }
-
- private boolean jj_3R_238() {
- if (jj_3R_244()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_17()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_327() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_286()) return true;
- return false;
- }
-
- private boolean jj_3R_288() {
- if (jj_3R_85()) return true;
- return false;
- }
-
- private boolean jj_3R_246() {
- if (jj_scan_token(INSTANCEOF)) return true;
- if (jj_3R_60()) return true;
- return false;
- }
-
- private boolean jj_3R_271() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_288()) jj_scanpos = xsp;
- if (jj_3R_77()) return true;
- if (jj_3R_289()) return true;
- xsp = jj_scanpos;
- if (jj_3R_290()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_291()) {
- jj_scanpos = xsp;
- if (jj_scan_token(83)) return true;
- }
- return false;
- }
-
- private boolean jj_3R_109() {
- if (jj_scan_token(ORASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_260() {
- if (jj_scan_token(LT)) return true;
- return false;
- }
-
- private boolean jj_3R_252() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_260()) {
- jj_scanpos = xsp;
- if (jj_3R_261()) {
- jj_scanpos = xsp;
- if (jj_3R_262()) {
- jj_scanpos = xsp;
- if (jj_3R_263()) return true;
- }
- }
- }
- if (jj_3R_238()) return true;
- return false;
- }
-
- private boolean jj_3R_233() {
- if (jj_3R_238()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_252()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_179() {
- if (jj_scan_token(FINAL)) return true;
- return false;
- }
-
- private boolean jj_3R_173() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_179()) jj_scanpos = xsp;
- if (jj_3R_60()) return true;
- if (jj_3R_286()) return true;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_327()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_108() {
- if (jj_scan_token(XORASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_248() {
- if (jj_scan_token(NE)) return true;
- return false;
- }
-
- private boolean jj_3_5() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_63()) return true;
- return false;
- }
-
- private boolean jj_3_34() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(31)) jj_scanpos = xsp;
- if (jj_3R_60()) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_164() {
- if (jj_3R_175()) return true;
- return false;
- }
-
- private boolean jj_3R_241() {
- if (jj_3R_63()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_5()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_163() {
- if (jj_3R_174()) return true;
- return false;
- }
-
- private boolean jj_3R_226() {
- if (jj_3R_233()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_246()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_162() {
- if (jj_3R_173()) return true;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_157() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_162()) {
- jj_scanpos = xsp;
- if (jj_3R_163()) {
- jj_scanpos = xsp;
- if (jj_3R_164()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_138() {
- if (jj_scan_token(LBRACE)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_241()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(84)) jj_scanpos = xsp;
- if (jj_scan_token(RBRACE)) return true;
- return false;
- }
-
- private boolean jj_3R_107() {
- if (jj_scan_token(ANDASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_331() {
- if (jj_scan_token(COLON)) return true;
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_137() {
- if (jj_3R_157()) return true;
- return false;
- }
-
- private boolean jj_3R_247() {
- if (jj_scan_token(EQ)) return true;
- return false;
- }
-
- private boolean jj_3R_243() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_247()) {
- jj_scanpos = xsp;
- if (jj_3R_248()) return true;
- }
- if (jj_3R_226()) return true;
- return false;
- }
-
- private boolean jj_3R_88() {
- if (jj_scan_token(LBRACE)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_137()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(RBRACE)) return true;
- return false;
- }
-
- private boolean jj_3R_90() {
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_217() {
- if (jj_3R_226()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_243()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_63() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_89()) {
- jj_scanpos = xsp;
- if (jj_3R_90()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_89() {
- if (jj_3R_138()) return true;
- return false;
- }
-
- private boolean jj_3R_106() {
- if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_237() {
- if (jj_scan_token(BIT_AND)) return true;
- if (jj_3R_217()) return true;
- return false;
- }
-
- private boolean jj_3R_80() {
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(COLON)) return true;
- if (jj_3R_174()) return true;
- return false;
- }
-
- private boolean jj_3R_323() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_200() {
- if (jj_3R_217()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_237()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_305() {
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_323()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_105() {
- if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_232() {
- if (jj_scan_token(XOR)) return true;
- if (jj_3R_200()) return true;
- return false;
- }
-
- private boolean jj_3R_306() {
- if (jj_scan_token(ASSIGN)) return true;
- if (jj_3R_63()) return true;
- return false;
- }
-
- private boolean jj_3R_178() {
- if (jj_3R_200()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_232()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_202() {
- if (jj_scan_token(ASSERT)) return true;
- if (jj_3R_70()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_331()) jj_scanpos = xsp;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_286() {
- if (jj_3R_305()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_306()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_104() {
- if (jj_scan_token(LSHIFTASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_225() {
- if (jj_scan_token(BIT_OR)) return true;
- if (jj_3R_178()) return true;
- return false;
- }
-
- private boolean jj_3R_171() {
- if (jj_3R_178()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_225()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_194() {
- if (jj_3R_215()) return true;
- return false;
- }
-
- private boolean jj_3R_193() {
- if (jj_3R_214()) return true;
- return false;
- }
-
- private boolean jj_3R_192() {
- if (jj_3R_213()) return true;
- return false;
- }
-
- private boolean jj_3R_287() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_286()) return true;
- return false;
- }
-
- private boolean jj_3R_103() {
- if (jj_scan_token(MINUSASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_191() {
- if (jj_3R_212()) return true;
- return false;
- }
-
- private boolean jj_3R_190() {
- if (jj_3R_211()) return true;
- return false;
- }
-
- private boolean jj_3R_189() {
- if (jj_3R_210()) return true;
- return false;
- }
-
- private boolean jj_3R_188() {
- if (jj_3R_209()) return true;
- return false;
- }
-
- private boolean jj_3R_187() {
- if (jj_3R_208()) return true;
- return false;
- }
-
- private boolean jj_3R_186() {
- if (jj_3R_207()) return true;
- return false;
- }
-
- private boolean jj_3R_61() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_270() {
- if (jj_3R_60()) return true;
- if (jj_3R_286()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_287()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_216() {
- if (jj_scan_token(SC_AND)) return true;
- if (jj_3R_171()) return true;
- return false;
- }
-
- private boolean jj_3R_185() {
- if (jj_3R_206()) return true;
- return false;
- }
-
- private boolean jj_3R_184() {
- if (jj_3R_205()) return true;
- return false;
- }
-
- private boolean jj_3_40() {
- if (jj_3R_60()) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(LPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_183() {
- if (jj_3R_204()) return true;
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_160() {
- if (jj_3R_171()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_216()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_182() {
- if (jj_3R_203()) return true;
- return false;
- }
-
- private boolean jj_3R_102() {
- if (jj_scan_token(PLUSASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_181() {
- if (jj_3R_88()) return true;
- return false;
- }
-
- private boolean jj_3R_180() {
- if (jj_3R_202()) return true;
- return false;
- }
-
- private boolean jj_3R_174() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_33()) {
- jj_scanpos = xsp;
- if (jj_3R_180()) {
- jj_scanpos = xsp;
- if (jj_3R_181()) {
- jj_scanpos = xsp;
- if (jj_3R_182()) {
- jj_scanpos = xsp;
- if (jj_3R_183()) {
- jj_scanpos = xsp;
- if (jj_3R_184()) {
- jj_scanpos = xsp;
- if (jj_3R_185()) {
- jj_scanpos = xsp;
- if (jj_3R_186()) {
- jj_scanpos = xsp;
- if (jj_3R_187()) {
- jj_scanpos = xsp;
- if (jj_3R_188()) {
- jj_scanpos = xsp;
- if (jj_3R_189()) {
- jj_scanpos = xsp;
- if (jj_3R_190()) {
- jj_scanpos = xsp;
- if (jj_3R_191()) {
- jj_scanpos = xsp;
- if (jj_3R_192()) {
- jj_scanpos = xsp;
- if (jj_3R_193()) {
- jj_scanpos = xsp;
- if (jj_3R_194()) return true;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3_33() {
- if (jj_3R_80()) return true;
- return false;
- }
-
- private boolean jj_3R_172() {
- if (jj_scan_token(BIT_AND)) return true;
- if (jj_3R_147()) return true;
- return false;
- }
-
- private boolean jj_3R_199() {
- if (jj_scan_token(SC_OR)) return true;
- if (jj_3R_160()) return true;
- return false;
- }
-
- private boolean jj_3_39() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_83()) return true;
- return false;
- }
-
- private boolean jj_3_3() {
- if (jj_3R_60()) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_61()) { jj_scanpos = xsp; break; }
- }
- xsp = jj_scanpos;
- if (jj_scan_token(84)) {
- jj_scanpos = xsp;
- if (jj_scan_token(87)) {
- jj_scanpos = xsp;
- if (jj_scan_token(83)) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_59() {
- if (jj_3R_85()) return true;
- return false;
- }
-
- private boolean jj_3_2() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_59()) jj_scanpos = xsp;
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(LPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_251() {
- if (jj_scan_token(SEMICOLON)) return true;
- return false;
- }
-
- private boolean jj_3R_101() {
- if (jj_scan_token(REMASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_150() {
- if (jj_3R_160()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_199()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_259() {
- if (jj_3R_271()) return true;
- return false;
- }
-
- private boolean jj_3R_258() {
- if (jj_3R_270()) return true;
- return false;
- }
-
- private boolean jj_3R_235() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_230() {
- Token xsp;
- if (jj_3R_235()) return true;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_235()) { jj_scanpos = xsp; break; }
- }
- if (jj_3R_138()) return true;
- return false;
- }
-
- private boolean jj_3R_257() {
- if (jj_3R_269()) return true;
- return false;
- }
-
- private boolean jj_3R_256() {
- if (jj_3R_268()) return true;
- return false;
- }
-
- private boolean jj_3R_152() {
- if (jj_scan_token(LBRACE)) return true;
- if (jj_3R_83()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_39()) { jj_scanpos = xsp; break; }
- }
- xsp = jj_scanpos;
- if (jj_scan_token(84)) jj_scanpos = xsp;
- if (jj_scan_token(RBRACE)) return true;
- return false;
- }
-
- private boolean jj_3R_342() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_341()) return true;
- return false;
- }
-
- private boolean jj_3_31() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_131() {
- if (jj_3R_110()) return true;
- return false;
- }
-
- private boolean jj_3R_255() {
- if (jj_3R_175()) return true;
- return false;
- }
-
- private boolean jj_3R_130() {
- if (jj_3R_152()) return true;
- return false;
- }
-
- private boolean jj_3R_100() {
- if (jj_scan_token(SLASHASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_129() {
- if (jj_3R_84()) return true;
- return false;
- }
-
- private boolean jj_3R_83() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_129()) {
- jj_scanpos = xsp;
- if (jj_3R_130()) {
- jj_scanpos = xsp;
- if (jj_3R_131()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_250() {
- if (jj_3R_254()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_255()) {
- jj_scanpos = xsp;
- if (jj_3R_256()) {
- jj_scanpos = xsp;
- if (jj_3R_257()) {
- jj_scanpos = xsp;
- if (jj_3R_258()) {
- jj_scanpos = xsp;
- if (jj_3R_259()) return true;
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3R_341() {
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(ASSIGN)) return true;
- if (jj_3R_83()) return true;
- return false;
- }
-
- private boolean jj_3_30() {
- if (jj_scan_token(LBRACKET)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(RBRACKET)) return true;
- return false;
- }
-
- private boolean jj_3R_221() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_32()) {
- jj_scanpos = xsp;
- if (jj_3R_230()) return true;
- }
- return false;
- }
-
- private boolean jj_3_32() {
- Token xsp;
- if (jj_3_30()) return true;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_30()) { jj_scanpos = xsp; break; }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_31()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_177() {
- if (jj_scan_token(HOOK)) return true;
- if (jj_3R_70()) return true;
- if (jj_scan_token(COLON)) return true;
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_329() {
- if (jj_3R_341()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_342()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3_4() {
- if (jj_3R_62()) return true;
- return false;
- }
-
- private boolean jj_3R_245() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_4()) {
- jj_scanpos = xsp;
- if (jj_3R_250()) {
- jj_scanpos = xsp;
- if (jj_3R_251()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_328() {
- if (jj_3R_329()) return true;
- return false;
- }
-
- private boolean jj_3R_110() {
- if (jj_3R_150()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_177()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_82() {
- if (jj_scan_token(IDENTIFIER)) return true;
- if (jj_scan_token(ASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_242() {
- if (jj_3R_245()) return true;
- return false;
- }
-
- private boolean jj_3R_222() {
- if (jj_3R_68()) return true;
- return false;
- }
-
- private boolean jj_3R_154() {
- if (jj_scan_token(AT)) return true;
- if (jj_3R_81()) return true;
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_83()) return true;
- if (jj_scan_token(RPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_99() {
- if (jj_scan_token(STARASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_236() {
- if (jj_scan_token(LBRACE)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_242()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(RBRACE)) return true;
- return false;
- }
-
- private boolean jj_3R_155() {
- if (jj_scan_token(AT)) return true;
- if (jj_3R_81()) return true;
- return false;
- }
-
- private boolean jj_3_38() {
- if (jj_scan_token(AT)) return true;
- if (jj_3R_81()) return true;
- if (jj_scan_token(LPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_153() {
- if (jj_scan_token(AT)) return true;
- if (jj_3R_81()) return true;
- if (jj_scan_token(LPAREN)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_328()) jj_scanpos = xsp;
- if (jj_scan_token(RPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_98() {
- if (jj_scan_token(ASSIGN)) return true;
- return false;
- }
-
- private boolean jj_3R_69() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_98()) {
- jj_scanpos = xsp;
- if (jj_3R_99()) {
- jj_scanpos = xsp;
- if (jj_3R_100()) {
- jj_scanpos = xsp;
- if (jj_3R_101()) {
- jj_scanpos = xsp;
- if (jj_3R_102()) {
- jj_scanpos = xsp;
- if (jj_3R_103()) {
- jj_scanpos = xsp;
- if (jj_3R_104()) {
- jj_scanpos = xsp;
- if (jj_3R_105()) {
- jj_scanpos = xsp;
- if (jj_3R_106()) {
- jj_scanpos = xsp;
- if (jj_3R_107()) {
- jj_scanpos = xsp;
- if (jj_3R_108()) {
- jj_scanpos = xsp;
- if (jj_3R_109()) return true;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- return false;
- }
-
- private boolean jj_3_37() {
- if (jj_scan_token(AT)) return true;
- if (jj_3R_81()) return true;
- if (jj_scan_token(LPAREN)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_82()) {
- jj_scanpos = xsp;
- if (jj_scan_token(78)) return true;
- }
- return false;
- }
-
- private boolean jj_3R_231() {
- if (jj_3R_236()) return true;
- return false;
- }
-
- private boolean jj_3R_134() {
- if (jj_3R_155()) return true;
- return false;
- }
-
- private boolean jj_3R_161() {
- if (jj_scan_token(EXTENDS)) return true;
- if (jj_3R_147()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_172()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_133() {
- if (jj_3R_154()) return true;
- return false;
- }
-
- private boolean jj_3R_132() {
- if (jj_3R_153()) return true;
- return false;
- }
-
- private boolean jj_3R_84() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_132()) {
- jj_scanpos = xsp;
- if (jj_3R_133()) {
- jj_scanpos = xsp;
- if (jj_3R_134()) return true;
- }
- }
- return false;
- }
-
- private boolean jj_3R_224() {
- if (jj_3R_66()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_231()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_111() {
- return false;
- }
-
- private boolean jj_3R_223() {
- if (jj_3R_221()) return true;
- return false;
- }
-
- private boolean jj_3R_156() {
- if (jj_3R_161()) return true;
- return false;
- }
-
- private boolean jj_3R_128() {
- if (jj_scan_token(NEW)) return true;
- if (jj_3R_147()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_222()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_223()) {
- jj_scanpos = xsp;
- if (jj_3R_224()) return true;
- }
- return false;
- }
-
- private boolean jj_3R_112() {
- return false;
- }
-
- private boolean jj_3R_72() {
- jj_lookingAhead = true;
- jj_semLA = getToken(1).kind == GT &&
- ((Token.GTToken)getToken(1)).realKind == RSIGNEDSHIFT;
- jj_lookingAhead = false;
- if (!jj_semLA || jj_3R_111()) return true;
- if (jj_scan_token(GT)) return true;
- if (jj_scan_token(GT)) return true;
- return false;
- }
-
- private boolean jj_3R_318() {
- if (jj_3R_236()) return true;
- return false;
- }
-
- private boolean jj_3R_135() {
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_156()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3_16() {
- if (jj_3R_69()) return true;
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_78() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_29()) {
- jj_scanpos = xsp;
- if (jj_3R_128()) return true;
- }
- return false;
- }
-
- private boolean jj_3_29() {
- if (jj_scan_token(NEW)) return true;
- if (jj_3R_75()) return true;
- if (jj_3R_221()) return true;
- return false;
- }
-
- private boolean jj_3R_70() {
- if (jj_3R_110()) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_16()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_322() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_81()) return true;
- return false;
- }
-
- private boolean jj_3R_73() {
- jj_lookingAhead = true;
- jj_semLA = getToken(1).kind == GT &&
- ((Token.GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT;
- jj_lookingAhead = false;
- if (!jj_semLA || jj_3R_112()) return true;
- if (jj_scan_token(GT)) return true;
- if (jj_scan_token(GT)) return true;
- if (jj_scan_token(GT)) return true;
- return false;
- }
-
- private boolean jj_3R_136() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_135()) return true;
- return false;
- }
-
- private boolean jj_3R_317() {
- if (jj_3R_66()) return true;
- return false;
- }
-
- private boolean jj_3R_85() {
- if (jj_scan_token(LT)) return true;
- if (jj_3R_135()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_136()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(GT)) return true;
- return false;
- }
-
- private boolean jj_3R_301() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_300()) return true;
- return false;
- }
-
- private boolean jj_3R_159() {
- if (jj_scan_token(COMMA)) return true;
- if (jj_3R_70()) return true;
- return false;
- }
-
- private boolean jj_3R_146() {
- if (jj_3R_70()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_159()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_319() {
- if (jj_3R_245()) return true;
- return false;
- }
-
- private boolean jj_3R_300() {
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_317()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_318()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3R_340() {
- if (jj_scan_token(FINALLY)) return true;
- if (jj_3R_88()) return true;
- return false;
- }
-
- private boolean jj_3R_94() {
- if (jj_3R_146()) return true;
- return false;
- }
-
- private boolean jj_3R_302() {
- if (jj_scan_token(SEMICOLON)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_319()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_304() {
- if (jj_3R_81()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_322()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- private boolean jj_3R_339() {
- if (jj_scan_token(CATCH)) return true;
- if (jj_scan_token(LPAREN)) return true;
- if (jj_3R_320()) return true;
- if (jj_scan_token(RPAREN)) return true;
- if (jj_3R_88()) return true;
- return false;
- }
-
- private boolean jj_3R_280() {
- if (jj_scan_token(LBRACE)) return true;
- if (jj_3R_300()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_301()) { jj_scanpos = xsp; break; }
- }
- xsp = jj_scanpos;
- if (jj_3R_302()) jj_scanpos = xsp;
- if (jj_scan_token(RBRACE)) return true;
- return false;
- }
-
- private boolean jj_3R_66() {
- if (jj_scan_token(LPAREN)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_94()) jj_scanpos = xsp;
- if (jj_scan_token(RPAREN)) return true;
- return false;
- }
-
- private boolean jj_3R_279() {
- if (jj_3R_299()) return true;
- return false;
- }
-
- private boolean jj_3R_268() {
- if (jj_scan_token(ENUM)) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_279()) jj_scanpos = xsp;
- if (jj_3R_280()) return true;
- return false;
- }
-
- private boolean jj_3R_215() {
- if (jj_scan_token(TRY)) return true;
- if (jj_3R_88()) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_339()) { jj_scanpos = xsp; break; }
- }
- xsp = jj_scanpos;
- if (jj_3R_340()) jj_scanpos = xsp;
- return false;
- }
-
- private boolean jj_3_15() {
- if (jj_scan_token(DOT)) return true;
- if (jj_scan_token(IDENTIFIER)) return true;
- return false;
- }
-
- private boolean jj_3R_81() {
- if (jj_scan_token(IDENTIFIER)) return true;
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_15()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
- /** Generated Token Manager. */
- public JavaParserTokenManager token_source;
- JavaCharStream jj_input_stream;
- /** Current token. */
- public Token token;
- /** Next token. */
- public Token jj_nt;
- private int jj_ntk;
- private Token jj_scanpos, jj_lastpos;
- private int jj_la;
- /** Whether we are looking ahead. */
- private boolean jj_lookingAhead = false;
- private boolean jj_semLA;
-
- /** Constructor with InputStream. */
- public JavaParser(java.io.InputStream stream) {
- this(stream, null);
- }
- /** Constructor with InputStream and supplied encoding */
- public JavaParser(java.io.InputStream stream, String encoding) {
- try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
- token_source = new JavaParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- }
-
- /** Reinitialise. */
- public void ReInit(java.io.InputStream stream) {
- ReInit(stream, null);
- }
- /** Reinitialise. */
- public void ReInit(java.io.InputStream stream, String encoding) {
- try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- }
-
- /** Constructor. */
- public JavaParser(java.io.Reader stream) {
- jj_input_stream = new JavaCharStream(stream, 1, 1);
- token_source = new JavaParserTokenManager(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- }
-
- /** Reinitialise. */
- public void ReInit(java.io.Reader stream) {
- jj_input_stream.ReInit(stream, 1, 1);
- token_source.ReInit(jj_input_stream);
- token = new Token();
- jj_ntk = -1;
- }
-
- /** Constructor with generated Token Manager. */
- public JavaParser(JavaParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- }
-
- /** Reinitialise. */
- public void ReInit(JavaParserTokenManager tm) {
- token_source = tm;
- token = new Token();
- jj_ntk = -1;
- }
-
- private Token jj_consume_token(int kind) throws ParseException {
- Token oldToken;
- if ((oldToken = token).next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- if (token.kind == kind) {
- return token;
- }
- token = oldToken;
- throw generateParseException();
- }
-
- static private final class LookaheadSuccess extends java.lang.Error { }
- final private LookaheadSuccess jj_ls = new LookaheadSuccess();
- private boolean jj_scan_token(int kind) {
- if (jj_scanpos == jj_lastpos) {
- jj_la--;
- if (jj_scanpos.next == null) {
- jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
- } else {
- jj_lastpos = jj_scanpos = jj_scanpos.next;
- }
- } else {
- jj_scanpos = jj_scanpos.next;
- }
- if (jj_scanpos.kind != kind) return true;
- if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
- return false;
- }
-
-
-/** Get the next Token. */
- final public Token getNextToken() {
- if (token.next != null) token = token.next;
- else token = token.next = token_source.getNextToken();
- jj_ntk = -1;
- return token;
- }
-
-/** Get the specific Token. */
- final public Token getToken(int index) {
- Token t = jj_lookingAhead ? jj_scanpos : token;
- for (int i = 0; i < index; i++) {
- if (t.next != null) t = t.next;
- else t = t.next = token_source.getNextToken();
- }
- return t;
- }
-
- private int jj_ntk() {
- if ((jj_nt=token.next) == null)
- return (jj_ntk = (token.next=token_source.getNextToken()).kind);
- else
- return (jj_ntk = jj_nt.kind);
- }
-
- /** Generate ParseException. */
- public ParseException generateParseException() {
- Token errortok = token.next;
- int line = errortok.beginLine, column = errortok.beginColumn;
- String mess = (errortok.kind == 0) ? tokenImage[0] : errortok.image;
- return new ParseException("Parse error at line " + line + ", column " + column + ". Encountered: " + mess);
- }
-
- /** Enable tracing. */
- final public void enable_tracing() {
- }
-
- /** Disable tracing. */
- final public void disable_tracing() {
- }
-
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.jj b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.jj
deleted file mode 100644
index ec01779..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParser.jj
+++ /dev/null
@@ -1,3242 +0,0 @@
-
-
-options {
- JAVA_UNICODE_ESCAPE = true;
- ERROR_REPORTING = false;
- STATIC = false;
-}
-
-PARSER_BEGIN(JavaParser)
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-import harsh.javatoxml.XMLHelper;
-import harsh.javatoxml.Exceptions.*;
-
-import java.io.*;
-import java.util.LinkedList;
-import java.util.Iterator;
-
-
-
-
-
-import harsh.javatoxml.data.*;
-
-/**
- * Grammar to parse Java version 1.5
- * @author Sreenivasa Viswanadha - Simplified and enhanced for 1.5
- */
-public class JavaParser
-{
- /**
- * Class to hold modifiers.
- */
- static public final class ModifierSet
- {
- /* Definitions of the bits in the modifiers field. */
- public static final int PUBLIC = 0x0001;
- public static final int PROTECTED = 0x0002;
- public static final int PRIVATE = 0x0004;
- public static final int ABSTRACT = 0x0008;
- public static final int STATIC = 0x0010;
- public static final int FINAL = 0x0020;
- public static final int SYNCHRONIZED = 0x0040;
- public static final int NATIVE = 0x0080;
- public static final int TRANSIENT = 0x0100;
- public static final int VOLATILE = 0x0200;
- public static final int STRICTFP = 0x1000;
-
- /** A set of accessors that indicate whether the specified modifier
- is in the set. */
-
- public static boolean isPublic(int modifiers)
- {
- return (modifiers & PUBLIC) != 0;
- }
-
- public static boolean isProtected(int modifiers)
- {
- return (modifiers & PROTECTED) != 0;
- }
-
- public static boolean isPrivate(int modifiers)
- {
- return (modifiers & PRIVATE) != 0;
- }
-
- public static boolean isStatic(int modifiers)
- {
- return (modifiers & STATIC) != 0;
- }
-
- public static boolean isAbstract(int modifiers)
- {
- return (modifiers & ABSTRACT) != 0;
- }
-
- public static boolean isFinal(int modifiers)
- {
- return (modifiers & FINAL) != 0;
- }
-
- public static boolean isNative(int modifiers)
- {
- return (modifiers & NATIVE) != 0;
- }
-
- public static boolean isStrictfp(int modifiers)
- {
- return (modifiers & STRICTFP) != 0;
- }
-
- public static boolean isSynchronized(int modifiers)
- {
- return (modifiers & SYNCHRONIZED) != 0;
- }
-
- public static boolean isTransient(int modifiers)
- {
- return (modifiers & TRANSIENT) != 0;
- }
-
- public static boolean isVolatile(int modifiers)
- {
- return (modifiers & VOLATILE) != 0;
- }
-
- /**
- * Removes the given modifier.
- */
- static int removeModifier(int modifiers, int mod)
- {
- return modifiers & ~mod;
- }
- }
-
-
-
- public static IXMLElement convert(Reader javaCode)
- throws JXMLException
- {
- try{
- JavaParser parser = new JavaParser(javaCode);
- IXMLElement root = parser.CompilationUnit();
- return root;
- }catch(ParseException e){
- throw new JXMLException(e.getMessage());
- }
- }
-
-
-
-
-
-
- private IXMLElement mergeElemsToBinary(LinkedList elems, LinkedList op){
- IXMLElement previous = (IXMLElement)elems.removeFirst();
- while (elems.size() > 0){
- IXMLElement next = (IXMLElement)elems.removeFirst();
- IXMLElement merge = new XMLElement();
- merge.setName("binary-expr");
- String operator = (String)op.removeFirst();
-
- // Faire la transformation des << ici
- operator = operator.replaceAll("<","<");
- operator = operator.replaceAll(">",">");
-
- merge.setAttribute("op",operator);
- merge.addChild(previous);
- merge.addChild(next);
- previous = merge;
- }
- return previous;
- }
-
- private void processModifiers(int modifiers, IXMLElement element)
- {
- boolean pri = ModifierSet.isPrivate(modifiers);
- boolean pub = ModifierSet.isPublic(modifiers);
- boolean pro = ModifierSet.isProtected(modifiers);
- if (pri)
- element.setAttribute("visibility","private");
- else if (pub)
- element.setAttribute("visibility","public");
- else if (pro)
- element.setAttribute("visibility","protected");
- else
- element.setAttribute("visibility","protected");
- //set abstract...
- if (ModifierSet.isAbstract(modifiers))
- element.setAttribute("abstract","true");
- if (ModifierSet.isFinal(modifiers))
- element.setAttribute("final","true");
- if (ModifierSet.isStatic(modifiers))
- element.setAttribute("static","true");
- if (ModifierSet.isSynchronized(modifiers))
- element.setAttribute("synchronized","true");
-
-
- }
-
-}
-
-PARSER_END(JavaParser)
-
-/* WHITE SPACE */
-
-SKIP :
-{
- " "
-| "\t"
-| "\n"
-| "\r"
-| "\f"
-}
-
-/* COMMENTS */
-
-MORE :
-{
- "//" : IN_SINGLE_LINE_COMMENT
-|
- <"/**" ~["/"]> { input_stream.backup(1); } : IN_FORMAL_COMMENT
-|
- "/*" : IN_MULTI_LINE_COMMENT
-}
-
-<IN_SINGLE_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
- <SINGLE_LINE_COMMENT: "\n" | "\r" | "\r\n" > : DEFAULT
-}
-
-<IN_FORMAL_COMMENT>
-SPECIAL_TOKEN :
-{
- <FORMAL_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_MULTI_LINE_COMMENT>
-SPECIAL_TOKEN :
-{
- <MULTI_LINE_COMMENT: "*/" > : DEFAULT
-}
-
-<IN_SINGLE_LINE_COMMENT,IN_FORMAL_COMMENT,IN_MULTI_LINE_COMMENT>
-MORE :
-{
- < ~[] >
-}
-
-/* RESERVED WORDS AND LITERALS */
-
-TOKEN :
-{
- < ABSTRACT: "abstract" >
-| < ASSERT: "assert" >
-| < BOOLEAN: "boolean" >
-| < BREAK: "break" >
-| < BYTE: "byte" >
-| < CASE: "case" >
-| < CATCH: "catch" >
-| < CHAR: "char" >
-| < CLASS: "class" >
-| < CONST: "const" >
-| < CONTINUE: "continue" >
-| < _DEFAULT: "default" >
-| < DO: "do" >
-| < DOUBLE: "double" >
-| < ELSE: "else" >
-| < ENUM: "enum" >
-| < EXTENDS: "extends" >
-| < FALSE: "false" >
-| < FINAL: "final" >
-| < FINALLY: "finally" >
-| < FLOAT: "float" >
-| < FOR: "for" >
-| < GOTO: "goto" >
-| < IF: "if" >
-| < IMPLEMENTS: "implements" >
-| < IMPORT: "import" >
-| < INSTANCEOF: "instanceof" >
-| < INT: "int" >
-| < INTERFACE: "interface" >
-| < LONG: "long" >
-| < NATIVE: "native" >
-| < NEW: "new" >
-| < NULL: "null" >
-| < PACKAGE: "package">
-| < PRIVATE: "private" >
-| < PROTECTED: "protected" >
-| < PUBLIC: "public" >
-| < RETURN: "return" >
-| < SHORT: "short" >
-| < STATIC: "static" >
-| < STRICTFP: "strictfp" >
-| < SUPER: "super" >
-| < SWITCH: "switch" >
-| < SYNCHRONIZED: "synchronized" >
-| < THIS: "this" >
-| < THROW: "throw" >
-| < THROWS: "throws" >
-| < TRANSIENT: "transient" >
-| < TRUE: "true" >
-| < TRY: "try" >
-| < VOID: "void" >
-| < VOLATILE: "volatile" >
-| < WHILE: "while" >
-}
-
-/* LITERALS */
-
-TOKEN :
-{
- < INTEGER_LITERAL:
- <DECIMAL_LITERAL> (["l","L"])?
- | <HEX_LITERAL> (["l","L"])?
- | <OCTAL_LITERAL> (["l","L"])?
- >
-|
- < #DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* >
-|
- < #HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
-|
- < #OCTAL_LITERAL: "0" (["0"-"7"])* >
-|
- < FLOATING_POINT_LITERAL:
- (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? (["f","F","d","D"])?
- | "." (["0"-"9"])+ (<EXPONENT>)? (["f","F","d","D"])?
- | (["0"-"9"])+ <EXPONENT> (["f","F","d","D"])?
- | (["0"-"9"])+ (<EXPONENT>)? ["f","F","d","D"]
- >
-|
- < #EXPONENT: ["e","E"] (["+","-"])? (["0"-"9"])+ >
-|
- < CHARACTER_LITERAL:
- "'"
- ( (~["'","\\","\n","\r"])
- | ("\\"
- ( ["n","t","b","r","f","\\","'","\""]
- | ["0"-"7"] ( ["0"-"7"] )?
- | ["0"-"3"] ["0"-"7"] ["0"-"7"]
- )
- )
- )
- "'"
- >
-|
- < STRING_LITERAL:
- "\""
- ( (~["\"","\\","\n","\r"])
- | ("\\"
- ( ["n","t","b","r","f","\\","'","\""]
- | ["0"-"7"] ( ["0"-"7"] )?
- | ["0"-"3"] ["0"-"7"] ["0"-"7"]
- )
- )
- )*
- "\""
- >
-}
-
-/* IDENTIFIERS */
-
-TOKEN :
-{
- < IDENTIFIER: <LETTER> (<LETTER>|<DIGIT>)* >
-|
- < #LETTER:
- [
- "\u0024",
- "\u0041"-"\u005a",
- "\u005f",
- "\u0061"-"\u007a",
- "\u00c0"-"\u00d6",
- "\u00d8"-"\u00f6",
- "\u00f8"-"\u00ff",
- "\u0100"-"\u1fff",
- "\u3040"-"\u318f",
- "\u3300"-"\u337f",
- "\u3400"-"\u3d2d",
- "\u4e00"-"\u9fff",
- "\uf900"-"\ufaff"
- ]
- >
-|
- < #DIGIT:
- [
- "\u0030"-"\u0039",
- "\u0660"-"\u0669",
- "\u06f0"-"\u06f9",
- "\u0966"-"\u096f",
- "\u09e6"-"\u09ef",
- "\u0a66"-"\u0a6f",
- "\u0ae6"-"\u0aef",
- "\u0b66"-"\u0b6f",
- "\u0be7"-"\u0bef",
- "\u0c66"-"\u0c6f",
- "\u0ce6"-"\u0cef",
- "\u0d66"-"\u0d6f",
- "\u0e50"-"\u0e59",
- "\u0ed0"-"\u0ed9",
- "\u1040"-"\u1049"
- ]
- >
-}
-
-/* SEPARATORS */
-
-TOKEN :
-{
- < LPAREN: "(" >
-| < RPAREN: ")" >
-| < LBRACE: "{" >
-| < RBRACE: "}" >
-| < LBRACKET: "[" >
-| < RBRACKET: "]" >
-| < SEMICOLON: ";" >
-| < COMMA: "," >
-| < DOT: "." >
-| < AT: "@" >
-}
-
-/* OPERATORS */
-
-TOKEN :
-{
- < ASSIGN: "=" >
-| < LT: "<" >
-| < BANG: "!" >
-| < TILDE: "~" >
-| < HOOK: "?" >
-| < COLON: ":" >
-| < EQ: "==" >
-| < LE: "<=" >
-| < GE: ">=" >
-| < NE: "!=" >
-| < SC_OR: "||" >
-| < SC_AND: "&&" >
-| < INCR: "++" >
-| < DECR: "--" >
-| < PLUS: "+" >
-| < MINUS: "-" >
-| < STAR: "*" >
-| < SLASH: "/" >
-| < BIT_AND: "&" >
-| < BIT_OR: "|" >
-| < XOR: "^" >
-| < REM: "%" >
-| < LSHIFT: "<<" >
-| < PLUSASSIGN: "+=" >
-| < MINUSASSIGN: "-=" >
-| < STARASSIGN: "*=" >
-| < SLASHASSIGN: "/=" >
-| < ANDASSIGN: "&=" >
-| < ORASSIGN: "|=" >
-| < XORASSIGN: "^=" >
-| < REMASSIGN: "%=" >
-| < LSHIFTASSIGN: "<<=" >
-| < RSIGNEDSHIFTASSIGN: ">>=" >
-| < RUNSIGNEDSHIFTASSIGN: ">>>=" >
-| < ELLIPSIS: "..." >
-}
-
-/* >'s need special attention due to generics syntax. */
-TOKEN :
-{
- < RUNSIGNEDSHIFT: ">>>" >
- {
- matchedToken.kind = GT;
- ((Token.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT;
- input_stream.backup(2);
- }
-| < RSIGNEDSHIFT: ">>" >
- {
- matchedToken.kind = GT;
- ((Token.GTToken)matchedToken).realKind = RSIGNEDSHIFT;
- input_stream.backup(1);
- }
-| < GT: ">" >
-}
-
-
-/*****************************************
- * THE JAVA LANGUAGE GRAMMAR STARTS HERE *
- *****************************************/
-
-/*
- * Program structuring syntax follows.
- */
-/**
- * Returns the IXMLElement corresponding to java-class-file
- */
-
-IXMLElement CompilationUnit():
-{
- IXMLElement javaSourceProgramElem = new XMLElement();
- javaSourceProgramElem.setName("java-class-file");
-
-}
-{
- [
- {
- IXMLElement packageDeclElem;
- }
- packageDeclElem = PackageDeclaration()
- {
- javaSourceProgramElem.addChild(packageDeclElem);
- }
- ]
- (
- {
- IXMLElement importElem;
- }
- importElem = ImportDeclaration()
- {
- javaSourceProgramElem.addChild(importElem);
- }
- )*
- (
- {
- IXMLElement classOrInterfaceElem;
- }
- classOrInterfaceElem = TypeDeclaration()
- {
- javaSourceProgramElem.addChild(classOrInterfaceElem);
- }
- )*
- <EOF>
- {
- return javaSourceProgramElem;
- }
-}
-
-/**
- * Returns the IXMLElement corresponding to a package Decleration
- * @return
- */
-IXMLElement PackageDeclaration():
-{
- IXMLElement packageDeclElem = new XMLElement();
- packageDeclElem.setName("package-decl");
-}
-{
- {
- String name;
- }
- "package"
- name=Name()
- ";"
- {
- packageDeclElem.setAttribute("name",name);
- return packageDeclElem;
- }
-
-}
-
-IXMLElement ImportDeclaration():
-{
- IXMLElement importElem = new XMLElement();
- importElem.setName("import");
- String name;
-}
-{
- "import" [
- "static"
- {
- importElem.setAttribute("static","true");
- }
- ] name=Name()
- [ "." "*"
- {
- name += ".*";
- }
- ] ";"
- //miss the semicolon :-?
- {
- importElem.setAttribute("module",name);
- return importElem;
- }
-}
-
-/*
- * Modifiers. We match all modifiers in a single rule to reduce the chances of
- * syntax errors for simple modifier mistakes. It will also enable us to give
- * better error messages.
- */
-
-int Modifiers():
-{
- int modifiers = 0;
-}
-{
- (
- LOOKAHEAD(2)
- (
- "public" { modifiers |= ModifierSet.PUBLIC; }
- |
- "static" { modifiers |= ModifierSet.STATIC; }
- |
- "protected" { modifiers |= ModifierSet.PROTECTED; }
- |
- "private" { modifiers |= ModifierSet.PRIVATE; }
- |
- "final" { modifiers |= ModifierSet.FINAL; }
- |
- "abstract" { modifiers |= ModifierSet.ABSTRACT; }
- |
- "synchronized" { modifiers |= ModifierSet.SYNCHRONIZED; }
- |
- "native" { modifiers |= ModifierSet.NATIVE; }
- |
- "transient" { modifiers |= ModifierSet.TRANSIENT; }
- |
- "volatile" { modifiers |= ModifierSet.VOLATILE; }
- |
- "strictfp" { modifiers |= ModifierSet.STRICTFP; }
- |
- Annotation()
- )
- )*
-
- {
- return modifiers;
- }
-}
-
-/*
- * Declaration syntax follows.
- */
-IXMLElement TypeDeclaration():
-{
- int modifiers;
- IXMLElement typeDeclElem=null;
-}
-{
- ";"
-|
- modifiers = Modifiers()
- (
- typeDeclElem=ClassOrInterfaceDeclaration(modifiers)
- |
- EnumDeclaration(modifiers)
- |
- AnnotationTypeDeclaration(modifiers)
- )
- {
- return typeDeclElem;
- }
-}
-
-/**
- *
- * @param modifiers
- * @return IXMLElement class Or interface IXMLElement
- */
-
-IXMLElement ClassOrInterfaceDeclaration(int modifiers):
-{
- boolean isInterface = false;
- IXMLElement classOrInterfaceElem = new XMLElement();
- Token t;
- IXMLElement temp;
-}
-{
- ( "class" {
- classOrInterfaceElem.setName("class");
-
- }| "interface" {
- isInterface = true;
- classOrInterfaceElem.setName("interface");
- if (ModifierSet.isPublic(modifiers))
- classOrInterfaceElem.setAttribute("visibility","public");
- }
- )
- t=<IDENTIFIER>
- {
- classOrInterfaceElem.setAttribute("name",t.image);
- processModifiers(modifiers, classOrInterfaceElem);
- }
- //TODO FIX Type Parameters
- [ temp=TypeParameters()
- {classOrInterfaceElem.addChild(temp);}
- ]
- [ ExtendsList(isInterface, classOrInterfaceElem) ]
- [ ImplementsList(isInterface, classOrInterfaceElem) ]
- ClassOrInterfaceBody(isInterface, classOrInterfaceElem)
- {
- return classOrInterfaceElem;
- }
-}
-
-
-
-/**
- * Populates the element with the extendList...
- *
- * @param isInterface
- * @param element
- */
-void ExtendsList(boolean isInterface, IXMLElement element):
-{
- boolean extendsMoreThanOne = false;
- IXMLElement type = null;
-
-}
-{
- "extends" type=ClassOrInterfaceType()
- {
- String name = type.getAttribute("name");
- IXMLElement extend = new XMLElement();
- if (isInterface){
- extend.setName("extend");
- extend.setAttribute("interface",name);
- }else{
- extend.setName("superclass");
- extend.setAttribute("name",name);
- }
- element.addChild(extend);
- }
- ( "," type=ClassOrInterfaceType()
- {
- name = type.getAttribute("name");
- extendsMoreThanOne = true;
- IXMLElement extendMore = new XMLElement();
- extendMore.setName("extend");
- extendMore.setAttribute("name",name);
- element.addChild(extendMore);
- }
- )*
- {
- if (extendsMoreThanOne && !isInterface)
- throw new ParseException("A class cannot extend more than one other class");
- }
-}
-
-void ImplementsList(boolean isInterface, IXMLElement element):
-{
- IXMLElement type;
-}
-{
- "implements" type=ClassOrInterfaceType()
- {
- String name = type.getAttribute("name");
- IXMLElement implementElem = new XMLElement();
- implementElem.setName("implement");
- implementElem.setAttribute("interface",name);
- element.addChild(implementElem);
- }
- ( "," type=ClassOrInterfaceType()
- {
- name = type.getAttribute("name");
- IXMLElement implementElemNext = new XMLElement();
- implementElemNext.setName("implement");
- implementElemNext.setAttribute("interface",name);
- element.addChild(implementElemNext);
- }
- )*
- {
- if (isInterface)
- throw new ParseException("An interface cannot implement other interfaces");
- }
-}
-
-/*
- * ditch enums for now...
- */
-
-void EnumDeclaration(int modifiers):
-{}
-{
- "enum" <IDENTIFIER>
- [ ImplementsList(false, null) ]
- EnumBody()
-}
-
-void EnumBody():
-{}
-{
- "{"
- EnumConstant() ( "," EnumConstant() )*
- [ ";" ( ClassOrInterfaceBodyDeclaration(false, null) )* ]
- "}"
-}
-
-void EnumConstant():
-{}
-{
- <IDENTIFIER> [ Arguments() ] [ ClassOrInterfaceBody(false, null) ]
-}
-
-
-IXMLElement TypeParameters():
-{
- IXMLElement typeParamElem = new XMLElement();
- typeParamElem.setName("type-parameters");
- IXMLElement temp;
-}
-{
- "<" temp=TypeParameter()
- {typeParamElem.addChild(temp);}
- ( "," temp=TypeParameter()
- {typeParamElem.addChild(temp);}
- )* ">"
- {
- return typeParamElem;
- }
-}
-
-IXMLElement TypeParameter():
-{
- IXMLElement typeElem = new XMLElement();
- typeElem.setName("type-parameter");
- Token t;
- IXMLElement temp;
-}
-{
- t=<IDENTIFIER>
- {
- typeElem.setAttribute("name",t.image);
- }
- [ temp=TypeBound()
- {
- typeElem.addChild(temp);
- }
- ]
- {
- return typeElem;
- }
-}
-
-
-
-IXMLElement TypeBound():
-{
- IXMLElement boundsElem = new XMLElement();
- boundsElem.setName("bounds");
- IXMLElement temp;
-}
-{
- "extends" temp=ClassOrInterfaceType(){boundsElem.addChild(temp);} ( "&" temp=ClassOrInterfaceType() {boundsElem.addChild(temp);} )*
-
- {
- return boundsElem;
- }
-}
-
-/**
- * process classOrInterface Body Declaration...
- *
- *
- */
-
-void ClassOrInterfaceBody(boolean isInterface, IXMLElement element):
-{}
-{
- "{" ( ClassOrInterfaceBodyDeclaration(isInterface, element) )* "}"
-}
-
-void ClassOrInterfaceBodyDeclaration(boolean isInterface, IXMLElement element):
-{
- boolean isNestedInterface = false;
- int modifiers;
- IXMLElement temp;
-}
-{
- LOOKAHEAD(2)
- temp=Initializer()
- {
- element.addChild(temp);
- if (isInterface)
- throw new ParseException("An interface cannot have initializers");
- }
-|
- modifiers = Modifiers() // Just get all the modifiers out of the way. If you want to do
- // more checks, pass the modifiers down to the member
- (
- temp=ClassOrInterfaceDeclaration(modifiers)
- {
- System.err.println(temp);
- element.addChild(temp);
- }
- |
- EnumDeclaration(modifiers) //TODO take care of this later
- |
- LOOKAHEAD( [ TypeParameters() ] <IDENTIFIER> "(" )
- temp=ConstructorDeclaration(modifiers)
- {
- element.addChild(temp);
- }
- |
- LOOKAHEAD( Type() <IDENTIFIER> ( "[" "]" )* ( "," | "=" | ";" ) )
- FieldDeclaration(modifiers, element)
- |
- temp=MethodDeclaration(modifiers)
- {
- element.addChild(temp);
- }
- )
-|
- ";"
-{
- IXMLElement emptyElem = new XMLElement();
- emptyElem.setName("empty");
- element.addChild(emptyElem);
-}
-}
-
-/*
- <!ELEMENT field (type,(array-initializer|%expr-elems;)?)>
- <!ATTLIST field
- name CDATA #REQUIRED
- continued (true|false) #IMPLIED
- %visibility-attribute;
- %mod-final;
- %mod-static;
- %mod-volatile;
- %mod-transient;
- %location-info;>
- */
-
-void FieldDeclaration(int modifiers, IXMLElement element):
-{
- IXMLElement typeElem;
- IXMLElement fieldElem;
-}
-{
- // Modifiers are already matched in the caller
- typeElem=Type()
- {
- fieldElem = new XMLElement();
- fieldElem.setName("field");
- fieldElem.addChild(XMLHelper.createCopy(typeElem));
- }
- VariableDeclarator(fieldElem)
- {
- processModifiers(modifiers, fieldElem);
- element.addChild(fieldElem);
- }
- ( ","
- {
- fieldElem = new XMLElement();
- fieldElem.setName("field");
-
- fieldElem.addChild(XMLHelper.createCopy(typeElem));
- }
- VariableDeclarator(fieldElem)
- {
- processModifiers(modifiers, fieldElem);
- element.addChild(fieldElem);
- }
- )* ";"
-}
-
-
-//variableDecl gets already made element for it..
-//this is done because type has to be known before hand...
-//
-void VariableDeclarator(IXMLElement variableDeclElem):
-{
- String name;
- //element to hold the initializer
- IXMLElement variableInitializer;
- IXMLElement typeContainer=variableDeclElem.getFirstChildNamed("type");
-}
-{
- name=VariableDeclaratorId(typeContainer)
- {
- variableDeclElem.setAttribute("name",name);
- }
- [ "=" variableInitializer=VariableInitializer()
- {
- variableDeclElem.addChild(variableInitializer);
- }
- ]
-}
-
-String VariableDeclaratorId(IXMLElement typeContainer):
-{
- Token t;
- String name;
- int dimensions = 0;
- String dimensionString = typeContainer.getAttribute("dimensions");
- if (dimensionString!=null){
- dimensions = Integer.parseInt(dimensionString);
- }
-}
-{
- t=<IDENTIFIER>
- {
- name = t.image;
- }
- ( "[" "]"
- {
- dimensions++;
- }
- )*
- {
- if (dimensions>0)
- typeContainer.setAttribute("dimensions",""+dimensions+"");
-
- return name;
- }
-}
-
-IXMLElement VariableInitializer():
-{
- IXMLElement variableInitElem;
-}
-{
- (
- variableInitElem=ArrayInitializer()
-|
- variableInitElem=Expression()
- )
- {
- return variableInitElem;
- }
-}
-
-/**
- * <!ELEMENT array-initializer (array-initializer|%expr-elems;)*>
- * <!ATTLIST array-initializer
- * length CDATA #REQUIRED>
- */
-IXMLElement ArrayInitializer():
-{
- int length = 0;
- IXMLElement temp;
- IXMLElement arrayInitElem = new XMLElement();
- arrayInitElem.setName("array-initializer");
-}
-{
- "{" [ temp=VariableInitializer()
- {
- arrayInitElem.addChild(temp);
- length++;
- }
- ( LOOKAHEAD(2) "," temp=VariableInitializer()
- {
- arrayInitElem.addChild(temp);
- length++;
- }
- )* ] [ "," ] "}"
- {
- arrayInitElem.setAttribute("length",""+length+"");
- return arrayInitElem;
- }
-}
-
-/*
-<!ELEMENT method (type,formal-arguments,throws*,block?)>
-<!ATTLIST method
- name CDATA #REQUIRED
- id ID #REQUIRED
- %visibility-attribute;
- %mod-abstract;
- %mod-final;
- %mod-static;
- %mod-synchronized;
- %mod-volatile;
- %mod-transient;
- %mod-native;
- %location-info;>
-
-*/
-IXMLElement MethodDeclaration(int modifiers):
-{
- IXMLElement methodElem = new XMLElement();
- methodElem.setName("method");
-
- IXMLElement temp;
-}
-{
- // Modifiers already matched in the caller!
- [ temp=TypeParameters()
- {
- methodElem.addChild(temp);
- }
- ] //TODO
- temp=ResultType()
- {
- methodElem.addChild(temp);
- }
- MethodDeclarator(methodElem)
- {
- processModifiers(modifiers, methodElem);
- }
- [ "throws"
- {
- LinkedList l;
- }
- l=NameList()
- {
- Iterator iter = l.iterator();
- while(iter.hasNext()){
- String exceptionName = (String)iter.next();
- IXMLElement exceptionElem = new XMLElement();
- exceptionElem.setName("throws");
- exceptionElem.setAttribute("exception",exceptionName);
- methodElem.addChild(exceptionElem);
- }
- }
- ]
- ( temp=Block(){methodElem.addChild(temp);} | ";" )
- {
- return methodElem;
- }
-}
-
-void MethodDeclarator(IXMLElement methodElem):
-{
- Token t;
- IXMLElement temp;
- IXMLElement typeElem = methodElem.getFirstChildNamed("type");
- String d = typeElem.getAttribute("dimensions");
- int dimensions = 0;
- if (d!=null)
- dimensions = Integer.parseInt(d);
-}
-{
- t=<IDENTIFIER>
- {methodElem.setAttribute("name",t.image);}
- temp=FormalParameters()
- {methodElem.addChild(temp);}
- ( "[" "]"
- {dimensions++;}
- )*
- {
- if (dimensions>0)
- typeElem.setAttribute("dimensions",""+dimensions+"");
- }
-}
-
-/*
-<!ELEMENT formal-arguments (formal-argument)*>
-*/
-IXMLElement FormalParameters():
-{
- IXMLElement formalArgElem = new XMLElement();
- formalArgElem.setName("formal-arguments");
- IXMLElement temp;
-}
-{
- "(" [ temp=FormalParameter(){formalArgElem.addChild(temp);} ( "," temp=FormalParameter() {formalArgElem.addChild(temp);})* ] ")"
- {
- return formalArgElem;
- }
-
-}
-
-/*
- <!ELEMENT formal-argument (type)>
- <!ATTLIST formal-argument
- name CDATA #REQUIRED
- id ID #REQUIRED
- %mod-final;>
- */
-IXMLElement FormalParameter():
-{
- IXMLElement formalArgElem = new XMLElement();
- formalArgElem.setName("formal-argument");
- IXMLElement typeElem;
- String varName;
-}
-{
- [ "final" {formalArgElem.setAttribute("final","true");}] typeElem=Type() [ "..." ] varName=VariableDeclaratorId(typeElem)
- {
- formalArgElem.setAttribute("name",varName);
- formalArgElem.addChild(typeElem);
- return formalArgElem;
- }
-}
-
-/*
-<!ELEMENT constructor (formal-arguments,throws*,(super-call|this-call)?,(%stmt-elems;)?)>
-<!ATTLIST constructor
- name CDATA #REQUIRED
- id ID #REQUIRED
- %visibility-attribute;
- %mod-final;
- %mod-static;
- %mod-synchronized;
- %mod-volatile;
- %mod-transient;
- %mod-native;
- %location-info;>
-*/
-IXMLElement ConstructorDeclaration(int modifiers):
-{
- IXMLElement constructorElem = new XMLElement();
- constructorElem.setName("constructor");
- processModifiers(modifiers, constructorElem);
- Token t;
- IXMLElement temp;
-}
-{
- //TODO ditched for now....
- [ temp=TypeParameters()
- {
- constructorElem.addChild(temp);
- }
- ]
- // Modifiers matched in the caller
- t=<IDENTIFIER> temp=FormalParameters()
- {
- constructorElem.setAttribute("name",t.image);
- constructorElem.addChild(temp);
- }
- [
- {
- LinkedList exceptionList;
- }
- "throws" exceptionList=NameList()
- {
- Iterator it = exceptionList.iterator();
- while(it.hasNext()){
- String exceptionName = (String)it.next();
- IXMLElement throwsElem = new XMLElement();
- throwsElem.setName("throws");
- throwsElem.setAttribute("exception",exceptionName);
- constructorElem.addChild(throwsElem);
- }
- }
-
- ]
- "{"
- [ LOOKAHEAD(ExplicitConstructorInvocation()) temp=ExplicitConstructorInvocation() {constructorElem.addChild(temp);}]
- ( BlockStatement(constructorElem) )*
- "}"
- {
- return constructorElem;
- }
-}
-
-IXMLElement ExplicitConstructorInvocation():
-{
- IXMLElement superOrThisCall = new XMLElement();
- IXMLElement argElem;
- IXMLElement temp;
-}
-{
- (
- LOOKAHEAD("this" Arguments() ";")
- "this" argElem=Arguments() ";"
- {
- superOrThisCall.setName("this-call");
- superOrThisCall.addChild(argElem);
- }
-|
- [ LOOKAHEAD(2) temp=PrimaryExpression() "."{superOrThisCall.addChild(temp);} ] "super" argElem=Arguments() ";"
- {
- superOrThisCall.setName("super-call");
- superOrThisCall.addChild(argElem);
- }
- )
- {
- return superOrThisCall;
- }
-}
-
-IXMLElement Initializer():
-{
- IXMLElement initializerElement = new XMLElement();
- initializerElement.setName("instance-initializer");
- IXMLElement block;
-}
-{
- [ "static"
- {
- initializerElement.setName("static-initializer");
- }
- ] block=Block()
- {
- initializerElement.addChild(block);
- }
- {
- return initializerElement;
- }
-}
-
-
-/*
- * Type, name and expression syntax follows.
- */
-/*
- * Parsing type
- * <!ELEMENT type EMPTY>
- * <!ATTLIST type
- * primitive CDATA #IMPLIED
- * name CDATA #REQUIRED
- * dimensions CDATA #IMPLIED
- * idref IDREF #IMPLIED>
- */
-
-IXMLElement Type():
-{
- IXMLElement typeElem;
-}
-{
- (
- (LOOKAHEAD(2) typeElem=ReferenceType()
- |
- typeElem=PrimitiveType()
- )
- )
- {
- return typeElem;
- }
-}
-
-IXMLElement ReferenceType():
-{
- IXMLElement referenceType;
- int dimensions = 0;
-}
-{
- (
- referenceType=PrimitiveType() ( LOOKAHEAD(2) "[" "]" {dimensions++;})+
- |
- ( referenceType=ClassOrInterfaceType() ) ( LOOKAHEAD(2) "[" "]" {dimensions++;})*
-
- )
- {
- if (dimensions>0)
- referenceType.setAttribute("dimensions",""+dimensions+"");
-
- return referenceType;
- }
-}
-
-IXMLElement ClassOrInterfaceType():
-{
- IXMLElement classOrInterfaceType = new XMLElement();
- classOrInterfaceType.setName("type");
- Token t;
- String name;
-}
-{
- (t=<IDENTIFIER>
- {
- name = t.image;
- }
- [ LOOKAHEAD(2) TypeArguments(classOrInterfaceType) ]
- ( LOOKAHEAD(2) "." t=<IDENTIFIER>
- { name += "."+t.image;}
- [ LOOKAHEAD(2) TypeArguments(classOrInterfaceType) ] )*
- )
- {
- classOrInterfaceType.setAttribute("name",name);
- return classOrInterfaceType;
- }
-}
-
-/*
- * parse typeArguments....
- *
- */
-void TypeArguments(IXMLElement typeElem):
-{
- IXMLElement temp;
-}
-{
- "<" temp=TypeArgument()
- {
- typeElem.addChild(temp);
- }
- ( "," temp=TypeArgument()
- {
- typeElem.addChild(temp);
- }
- )* ">"
-}
-
-/*
- * a type Argument...
- * <!ELEMENT type-argument (type|wildcard)>
- * <!ELEMENT wildcard (bound?)>
- * <!ELEMENT bound (type)>
- * <!ATTLIST bound type (upper|lower) #REQUIRED>
- *
- */
-IXMLElement TypeArgument():
-{
- IXMLElement typeArgumentElem = new XMLElement();
- typeArgumentElem.setName("type-argument");
- IXMLElement temp=null;
-}
-{
- (
- temp=ReferenceType()
- {
- typeArgumentElem.addChild(temp);
- }
- |
- "?" [ temp=WildcardBounds() ]
- {
- IXMLElement wildCard = new XMLElement();
- wildCard.setName("wildcard");
- if (temp!=null){
- //bound exist
- wildCard.addChild(temp);
- }
- typeArgumentElem.addChild(wildCard);
- }
- )
- {
- return typeArgumentElem;
- }
-}
-
-/**
- * bound
- *
- *
- * @return
- */
-IXMLElement WildcardBounds():
-{
- IXMLElement boundElem = new XMLElement();
- boundElem.setName("bound");
- IXMLElement temp=null;
-}
-{
- (
- "extends" temp=ReferenceType()
- {
- boundElem.setAttribute("type","upper");
- boundElem.addChild(temp);
- }
- |
- "super" temp=ReferenceType()
- {
- boundElem.setAttribute("type","lower");
- boundElem.addChild(temp);
- }
- )
- {
- return boundElem;
- }
-}
-
-
-IXMLElement PrimitiveType():
-{
- IXMLElement primitiveTypeElem = new XMLElement();
- primitiveTypeElem.setName("type");
- primitiveTypeElem.setAttribute("primitive","true");
-}
-{
- (
- "boolean"
- {
- primitiveTypeElem.setAttribute("name","boolean");
- }
-|
- "char"
- {
- primitiveTypeElem.setAttribute("name","char");
- }
-|
- "byte"
- {
- primitiveTypeElem.setAttribute("name","byte");
- }
-|
- "short"
- {
- primitiveTypeElem.setAttribute("name","short");
- }
-|
- "int"
- {
- primitiveTypeElem.setAttribute("name","int");
- }
-|
- "long"
- {
- primitiveTypeElem.setAttribute("name","long");
- }
-|
- "float"
- {
- primitiveTypeElem.setAttribute("name","float");
- }
-|
- "double"
- {
- primitiveTypeElem.setAttribute("name","double");
- }
- )
- {
- return primitiveTypeElem;
- }
-}
-
-IXMLElement ResultType():
-{
- IXMLElement resultTypeElem;
-}
-{
- ("void"
- {
- resultTypeElem = new XMLElement();
- resultTypeElem.setName("type");
- resultTypeElem.setAttribute("name","void");
- resultTypeElem.setAttribute("primitive","true");
- }
-|
- resultTypeElem=Type()
- )
- {
- return resultTypeElem;
- }
-}
-
-String Name():
-/*
- * A lookahead of 2 is required below since "Name" can be followed
- * by a ".*" when used in the context of an "ImportDeclaration".
- */
-{
- String name = "";
- Token t;
-}
-{
-
- t=<IDENTIFIER>
- {
- name += t.image;
- }
- ( LOOKAHEAD(2) "."
- t = <IDENTIFIER>
- {
- name += "."+t.image;
- }
- )*
- {
- return name;
- }
-}
-
-LinkedList NameList():
-{
- LinkedList l = new LinkedList();
- String temp;
-}
-{
- temp=Name(){l.add(temp);} ( "," temp=Name(){l.add(temp);} )*
- {
- return l;
- }
-}
-
-
-/*
- * Expression syntax follows.
- */
-
-IXMLElement Expression():
-/*
- * This expansion has been written this way instead of:
- * Assignment() | ConditionalExpression()
- * for performance reasons.
- * However, it is a weakening of the grammar for it allows the LHS of
- * assignments to be any conditional expression whereas it can only be
- * a primary expression. Consider adding a semantic predicate to work
- * around this.
- */
-{
- IXMLElement expressionElement;
- boolean isAssignment = false;
- IXMLElement leftElement = null;
- IXMLElement rightElement = null;
- String operator=null;
-}
-{
- leftElement=ConditionalExpression()
- [
- LOOKAHEAD(2)
- operator=AssignmentOperator()
- rightElement=Expression()
- {
- isAssignment = true;
- }
- ]
- {
- if (isAssignment){
- IXMLElement lvalueElement = new XMLElement();
- lvalueElement.setName("lvalue");
- lvalueElement.addChild(leftElement);
-
- expressionElement = new XMLElement();
- expressionElement.setName("assignment-expr");
- expressionElement.setAttribute("op",operator);
- //this has to be lvalue..
- expressionElement.addChild(lvalueElement);
- //this can be any expression
- expressionElement.addChild(rightElement);
- return expressionElement;
- }else{
- return leftElement;
- }
- }
-}
-
-/**
- * There are 12 assignment operators...
- * @return
- */
-String AssignmentOperator():
-{
-}
-{
- "="
- {return "=";}
- | "*=" {return "*=";}| "/=" {return "/=";}| "%="{return "%=";} | "+=" {return "+=";}| "-="{return "-=";} | "<<="{return "<<=";} | ">>="{return ">>=";} | ">>>="{return ">>>=";} | "&="{return "&=";} | "^=" {return "^=";}| "|="{return "|=";}
-
-}
-
-/**
- *
- * @return the conditional expression...
- */
-IXMLElement ConditionalExpression():
-{
- IXMLElement conditionalElem;
- IXMLElement conditionalOrElem;
- IXMLElement trueExprElem=null, falseExprElem=null;
- boolean isConditional = false;
-}
-{
- conditionalOrElem=ConditionalOrExpression()
- [
- "?" trueExprElem=Expression() ":" falseExprElem=Expression()
- {
- isConditional = true;
- }
- ]
- {
- if (isConditional){
- conditionalElem = new XMLElement();
- conditionalElem.setName("conditional-expr");
- conditionalElem.addChild(conditionalOrElem);
- conditionalElem.addChild(trueExprElem);
- conditionalElem.addChild(falseExprElem);
- return conditionalElem;
- }else{
- return conditionalOrElem;
- }
- }
-}
-
-IXMLElement ConditionalOrExpression():
-{
- LinkedList conditionalAndElem=new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp=null;
-}
-{
- (
- temp=ConditionalAndExpression()
- {
- conditionalAndElem.add(temp);
- }
- (
- "||" temp=ConditionalAndExpression()
- {
- System.out.println("hello ");
- conditionalAndElem.add(temp);
- operator.add("||");
- }
- )*
- )
- //transform all of them into binary expressions..
- {
-
- return mergeElemsToBinary(conditionalAndElem, operator);
- }
-
-}
-
-IXMLElement ConditionalAndExpression():
-{
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp=null;
-}
-{
- temp=InclusiveOrExpression()
- {
- elemList.add(temp);
- }
- ( "&&" temp=InclusiveOrExpression()
- {
- operator.add("&&");
- elemList.add(temp);
- }
-
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-
-}
-
-IXMLElement InclusiveOrExpression():
-{
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp;
-
-}
-{
- temp=ExclusiveOrExpression()
- {
- elemList.add(temp);
- }
- ( "|" temp=ExclusiveOrExpression()
- {
- elemList.add(temp);
- operator.add("|");
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-IXMLElement ExclusiveOrExpression():
-{
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp;
-}
-{
- temp=AndExpression()
- {
- elemList.add(temp);
- }
- ( "^" temp=AndExpression()
- {
- elemList.add(temp);
- operator.add("^");
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-IXMLElement AndExpression():
-{
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- IXMLElement temp;
-}
-{
- temp=EqualityExpression()
- {
- elemList.add(temp);
- }
- ( "&" temp=EqualityExpression()
- {
- elemList.add(temp);
- operator.add("&");
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-IXMLElement EqualityExpression():
-{
- IXMLElement temp;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
-}
-{
- temp=InstanceOfExpression()
- {
- elemList.add(temp);
- }
- ( ( "==" {operator.add("==");}| "!="{operator.add("!=");} ) temp=InstanceOfExpression()
- {
- elemList.add(temp);
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-IXMLElement InstanceOfExpression():
-{
- IXMLElement instanceOfElem = new XMLElement();
- instanceOfElem.setName("instanceof-test");
- IXMLElement relationalElem=null;
- IXMLElement type=null;
- boolean isInstanceOf = false;
-}
-{
- relationalElem=RelationalExpression() [ "instanceof" type=Type()
- {
- isInstanceOf = true;
- }
- ]
- {
- if (isInstanceOf){
- instanceOfElem.addChild(relationalElem);
- instanceOfElem.addChild(type);
- return instanceOfElem;
- }else
- return relationalElem;
- }
-}
-
-IXMLElement RelationalExpression():
-{
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
-}
-{
- temp=ShiftExpression()
- {
- elemList.add(temp);
- }
- ( ( "<"{operator.add("<");} | ">"{operator.add(">");} | "<=" {operator.add("<=");}| ">=" {operator.add(">=");}) temp=ShiftExpression()
- {
- elemList.add(temp);
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-IXMLElement ShiftExpression():
-{
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
- String storeOp=null;
-}
-{
- temp=AdditiveExpression()
- {elemList.add(temp);}
- ( ( "<<" {operator.add("<<");}| storeOp=RSIGNEDSHIFT(){operator.add(storeOp);} | storeOp=RUNSIGNEDSHIFT(){operator.add(storeOp);} )
- temp=AdditiveExpression()
- {
- elemList.add(temp);
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-IXMLElement AdditiveExpression():
-{
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
-}
-{
- temp=MultiplicativeExpression()
- {
- elemList.add(temp);
- }
- ( ( "+" {operator.add("+");}| "-" {operator.add("-");})
- temp=MultiplicativeExpression()
- {
- elemList.add(temp);
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-IXMLElement MultiplicativeExpression():
-{
- IXMLElement temp=null;
- LinkedList elemList = new LinkedList();
- LinkedList operator = new LinkedList();
-}
-{
- temp=UnaryExpression()
- {
- elemList.add(temp);
- }
- ( ( "*" {operator.add("*");}| "/" {operator.add("/");}| "%" {operator.add("%");}) temp=UnaryExpression()
- {
- elemList.add(temp);
- }
- )*
- {
- return mergeElemsToBinary(elemList, operator);
- }
-}
-
-/**
- *
- * @return unary-expr
- */
-IXMLElement UnaryExpression():
-{
- IXMLElement unaryElem=null;
- IXMLElement temp=null;
- String op=null;
-}
-{
- (
- ( "+" {op="+";}| "-"{op="-";} ) temp=UnaryExpression()
- {
- unaryElem = new XMLElement();
- unaryElem.setName("unary-expr");
- unaryElem.setAttribute("op",op);
- unaryElem.addChild(temp);
- }
-|
- unaryElem=PreIncrementExpression()
-|
- unaryElem=PreDecrementExpression()
-|
- unaryElem=UnaryExpressionNotPlusMinus()
- )
- {
- return unaryElem;
- }
-}
-
-IXMLElement PreIncrementExpression():
-{
- IXMLElement unaryElem = new XMLElement();
- unaryElem.setName("unary-expr");
- unaryElem.setAttribute("post","false");
- unaryElem.setAttribute("op","++");
- IXMLElement temp=null;
-}
-{
- "++" temp=PrimaryExpression()
- {
- unaryElem.addChild(temp);
- return unaryElem;
- }
-}
-
-IXMLElement PreDecrementExpression():
-{
- IXMLElement unaryElem = new XMLElement();
- unaryElem.setName("unary-expr");
- unaryElem.setAttribute("post","false");
- unaryElem.setAttribute("op","--");
- IXMLElement temp=null;
-}
-{
- "--" temp=PrimaryExpression()
- {
- unaryElem.addChild(temp);
- return unaryElem;
- }
-}
-
-IXMLElement UnaryExpressionNotPlusMinus():
-{
- IXMLElement unaryExprElem=null;
- IXMLElement temp=null;
- String op=null;
-}
-{
- (
- ( "~"{op="~";} | "!"{op="!";} ) temp=UnaryExpression()
- {
- unaryExprElem = new XMLElement();
- unaryExprElem.setName("unary-expr");
- unaryExprElem.setAttribute("op",op);
- unaryExprElem.addChild(temp);
- }
-|
- LOOKAHEAD( CastLookahead() )
- unaryExprElem=CastExpression()
-|
- unaryExprElem=PostfixExpression()
- )
- {
- return unaryExprElem;
- }
-}
-
-// This production is to determine lookahead only. The LOOKAHEAD specifications
-// below are not used, but they are there just to indicate that we know about
-// this.
-void CastLookahead():
-{}
-{
- LOOKAHEAD(2)
- "(" PrimitiveType()
-|
- LOOKAHEAD("(" Type() "[")
- "(" Type() "[" "]"
-|
- "(" Type() ")" ( "~" | "!" | "(" | <IDENTIFIER> | "this" | "super" | "new" | Literal() )
-}
-
-/**
- * parse postfix unary-expr
- * @return
- */
-IXMLElement PostfixExpression():
-{
- IXMLElement unaryExpr = null;
- IXMLElement temp;
- String op=null;
- boolean isPostfix=false;
-}
-{
- temp=PrimaryExpression() [ "++" {isPostfix=true;op="++";}| "--"{isPostfix=true;op="--";} ]
- {
- if (isPostfix){
- unaryExpr = new XMLElement();
- unaryExpr.setName("unary-expr");
- unaryExpr.setAttribute("post","true");
- unaryExpr.setAttribute("op",op);
- unaryExpr.addChild(temp);
- return unaryExpr;
- }else{
- return temp;
- }
- }
-}
-
-/**
- * <!ELEMENT cast-expr (type,(%expr-elems;))>
- * @return
- */
-IXMLElement CastExpression():
-{
- IXMLElement castExprElem = new XMLElement();
- castExprElem.setName("cast-expr");
- IXMLElement typeElem = null;
- IXMLElement exprElem = null;
-}
-{
- (
- LOOKAHEAD("(" PrimitiveType())
- "(" typeElem=Type() ")" exprElem=UnaryExpression()
-|
- "(" typeElem=Type() ")" exprElem=UnaryExpressionNotPlusMinus()
- )
- {
- castExprElem.addChild(typeElem);
- castExprElem.addChild(exprElem);
- return castExprElem;
- }
-}
-
-/**
- * parses the primary expression....
- * @return
- */
-IXMLElement PrimaryExpression():
-{
- IXMLElement primaryElement;
-}
-{
- primaryElement=PrimaryPrefix() ( LOOKAHEAD(2) primaryElement=PrimarySuffix(primaryElement) )*
- {
- return primaryElement;
- }
-}
-
-void MemberSelector():
-{}
-{
- "." TypeArguments(null) <IDENTIFIER>
-}
-
-
-IXMLElement PrimaryPrefix():
-{
- IXMLElement prefixElement;
- Token t;
- IXMLElement temp;
- IXMLElement typeElem;
-}
-{
- (
- prefixElement=Literal()
-|
- "this"
-{
- prefixElement = new XMLElement();
- prefixElement.setName("this");
-}
-|
- "super" "." t=<IDENTIFIER>
- {
- IXMLElement superElem = new XMLElement();
- superElem.setName("super");
- IXMLElement fieldAccess = new XMLElement();
- fieldAccess.setName("field-access");
- fieldAccess.setAttribute("field",t.image);
- fieldAccess.addChild(superElem);
- prefixElement = fieldAccess;
- }
-|
- "(" temp=Expression() ")"
- {
- IXMLElement parenElement = new XMLElement();
- parenElement.setName("paren");
- parenElement.addChild(temp);
- prefixElement = parenElement;
- }
-|
- prefixElement=AllocationExpression()
-|
- LOOKAHEAD( ResultType() "." "class" )
- typeElem=ResultType() "." "class"
- {
- IXMLElement fieldAccess2 = new XMLElement();
- fieldAccess2.setName("field-access");
- fieldAccess2.setAttribute("field", "class");
- fieldAccess2.addChild(typeElem);
- prefixElement = fieldAccess2;
- }
-|
- t=<IDENTIFIER>
- {
- prefixElement = new XMLElement();
- prefixElement.setName("var-ref");
- prefixElement.setAttribute("name",t.image);
- }
- )
- {
- return prefixElement;
- }
-}
-
-IXMLElement PrimarySuffix(IXMLElement prefixElement):
-{
- IXMLElement suffixElement=null;
- Token t=null;
- IXMLElement temp;
-}
-{
- (
- LOOKAHEAD(2)
- "." "this"
- {
- suffixElement = new XMLElement();
- suffixElement.setName("field-access");
- suffixElement.setAttribute("field","this");
- suffixElement.addChild(prefixElement);
- }
-|
- LOOKAHEAD(2)
- "." temp=AllocationExpression()
- {
- /*
- * What to do here :-SS
- */
- }
-|
- LOOKAHEAD(3)
- MemberSelector()
- //FIXME do somethind here before you DIE
-|
- "[" temp=Expression() "]"
- {
- suffixElement = new XMLElement();
- suffixElement.setName("array-ref");
- IXMLElement baseElem = new XMLElement();
- baseElem.setName("base");
- baseElem.addChild(prefixElement);
- IXMLElement offsetElem = new XMLElement();
- offsetElem.setName("offset");
- offsetElem.addChild(temp);
- suffixElement.addChild(baseElem);
- suffixElement.addChild(offsetElem);
- }
-|
- "." t=<IDENTIFIER>
- {
- suffixElement = new XMLElement();
- suffixElement.setName("field-access");
- suffixElement.setAttribute("field",t.image);
- suffixElement.addChild(prefixElement);
- }
-
-|
- temp=Arguments()
- {
- /*
- * well so the argument is called... now previous element's root should be
- * a field-access or a var-ref
- * else we don't know what to do...
- */
- suffixElement = new XMLElement();
- suffixElement.setName("send");
-
- if (prefixElement.getName().equals("field-access")){
- //modify this....
- suffixElement.setAttribute("message",prefixElement.getAttribute("field"));
- IXMLElement targetElem = new XMLElement();
- targetElem.setName("target");
- targetElem.addChild(prefixElement.getChildAtIndex(0));
- suffixElement.addChild(targetElem);
- suffixElement.addChild(temp);
-
- }else if (prefixElement.getName().equals("var-ref")){
- suffixElement.setAttribute("message", prefixElement.getAttribute("name"));
- suffixElement.addChild(temp);
- }
-
- }
- )
- {
- return suffixElement;
- }
-}
-
-
-
-
-/**
- *
- * @return the IXMLElement corresponding to the literal
- */
-IXMLElement Literal():
-{
- Token t;
- IXMLElement literalElement = new XMLElement();
- String temp;
-}
-{
- (
- t=<INTEGER_LITERAL>
- {
- literalElement.setName("literal-number");
- literalElement.setAttribute("kind","integer");
- literalElement.setAttribute("value",t.image);
- }
-|
- t=<FLOATING_POINT_LITERAL>
- {
- literalElement.setName("literal-number");
- literalElement.setAttribute("kind","float");
- literalElement.setAttribute("value",t.image);
- }
-|
- t=<CHARACTER_LITERAL>
- {
- literalElement.setName("literal-char");
- literalElement.setAttribute("value",t.image);
- }
-|
- t=<STRING_LITERAL>
- {
- literalElement.setName("literal-string");
- literalElement.setAttribute("value",t.image);
- }
-|
-
- temp=BooleanLiteral()
- {
- literalElement.setName("literal-boolean");
- literalElement.setAttribute("value", temp);
- }
-|
- NullLiteral()
- {
- literalElement.setName("literal-null");
- }
- )
- {
- return literalElement;
- }
-}
-
-String BooleanLiteral():
-{}
-{
- "true"
- {
- return "true";
- }
-|
- "false"
- {
- return "false";
- }
-}
-
-void NullLiteral():
-{}
-{
- "null"
-}
-
-
-/**
- *
- * @return an arguments type element
- */
-
-IXMLElement Arguments():
-{
- IXMLElement argumentElem = new XMLElement();
- argumentElem.setName("arguments");
-}
-{
- "(" [ ArgumentList(argumentElem) ] ")"
- {
- return argumentElem;
- }
-}
-
-void ArgumentList(IXMLElement argumentElem):
-{
- IXMLElement temp;
-}
-{
- temp=Expression()
- {
- argumentElem.addChild(temp);
- }
- ( "," temp=Expression()
- {
- argumentElem.addChild(temp);
- }
- )*
-}
-
-IXMLElement AllocationExpression():
-{
- IXMLElement newElement;//can be new or new-array
-
- IXMLElement typeElem;
-
-
-}
-{
- (
- LOOKAHEAD(2)
- "new" typeElem=PrimitiveType()
- {
- newElement = new XMLElement();
- newElement.setName("new-array");
- newElement.addChild(typeElem);
- }
- ArrayDimsAndInits(newElement)
-|
- "new" typeElem=ClassOrInterfaceType() [ TypeArguments(typeElem) ]
- {
- newElement = new XMLElement();
- //newElement.setName("new-array"); cant decide now
- newElement.addChild(typeElem);
- }
- (
- ArrayDimsAndInits(newElement)
- {
- newElement.setName("new-array");
- }
- |
- {
- IXMLElement argumentsElem;
- IXMLElement anonymousElem = null;
- }
- argumentsElem=Arguments() [
-
- {
- anonymousElem = new XMLElement();
- anonymousElem.setName("anonymous-class");
- }
- ClassOrInterfaceBody(false, anonymousElem)
-
- ] //parse this also to an anonymous class
- {
- newElement.setName("new");
- newElement.addChild(argumentsElem);
- if (anonymousElem!=null)
- newElement.addChild(anonymousElem);
- }
- )
- )
- {
- return newElement;
- }
-}
-
-/*
- * The third LOOKAHEAD specification below is to parse to PrimarySuffix
- * if there is an expression between the "[...]".
- */
-void ArrayDimsAndInits(IXMLElement element):
-{
- IXMLElement temp;
- int dimensions = 0;
-}
-{
- (
- LOOKAHEAD(2)
- ( LOOKAHEAD(2) "[" temp=Expression() "]"
- {
- IXMLElement dimElem = new XMLElement();
- dimElem.setName("dim-expr");
- dimElem.addChild(temp);
- element.addChild(dimElem);
- dimensions++;
- }
- )+
-
- ( LOOKAHEAD(2) "[" "]"
- {
- IXMLElement dimElem = new XMLElement();
- dimElem.setName("dim-expr");
- element.addChild(dimElem);
- dimensions++;
- }
- )*
-|
- ( "[" "]"
- {
- IXMLElement dimElem = new XMLElement();
- dimElem.setName("dim-expr");
- element.addChild(dimElem);
- dimensions++;
- }
- )+ temp=ArrayInitializer()
- )
- {
- element.setAttribute("dimensions",""+dimensions+"");
- }
-}
-
-
-/*
- * Statement syntax follows.
- */
-
-IXMLElement Statement():
-{
- IXMLElement statement=null;
-}
-{
- (
- LOOKAHEAD(2)
- statement=LabeledStatement()
-|
- statement=AssertStatement()
-|
- statement=Block()
-|
- statement=EmptyStatement()
-|
- statement=StatementExpression() ";"
-|
- statement=SwitchStatement()
-|
- statement=IfStatement()
-|
- statement=WhileStatement()
-|
- statement=DoStatement()
-|
- statement=ForStatement()
-|
- statement=BreakStatement()
-|
- statement=ContinueStatement()
-|
- statement=ReturnStatement()
-|
- statement=ThrowStatement()
-|
- statement=SynchronizedStatement()
-|
- statement=TryStatement()
- )
- {
- return statement;
- }
-}
-
-/**
- * <!ELEMENT assert (condition,error-message?)>
- * <!ELEMENT condition (%expr-elems;)>
- * <!ELEMENT error-message (%expr-elems;)>
- */
-IXMLElement AssertStatement():
-{
- IXMLElement assertElem = new XMLElement();
- assertElem.setName("assert");
- IXMLElement conditionElem = new XMLElement();
- conditionElem.setName("condition");
- IXMLElement expr1, expr2;
-}
-{
- "assert" expr1=Expression()
- {
- conditionElem.addChild(expr1);
- assertElem.addChild(conditionElem);
- }
-
- [ ":" expr2=Expression()
- {
- IXMLElement errorElem = new XMLElement();
- errorElem.setName("error-message");
- errorElem.addChild(expr2);
- assertElem.addChild(errorElem);
- }
-
- ] ";"
- {
- return assertElem;
- }
-}
-
-/**
- * Parse the labeled Statement
- */
-IXMLElement LabeledStatement():
-{
- Token t;
- IXMLElement statementElem;
-}
-{
- t=<IDENTIFIER> ":" statementElem=Statement()
- {
- IXMLElement labelElem = new XMLElement();
- labelElem.setName("label");
- labelElem.setAttribute("name",t.image);
- labelElem.addChild(statementElem);
- return labelElem;
- }
-}
-
-/**
- * pass element to Block as there are many elements to be added
- * @param element
- * @return
- */
-IXMLElement Block():
-{
- IXMLElement block = new XMLElement();
- block.setName("block");
-}
-{
- "{" ( BlockStatement(block) )* "}"
- {
- return block;
- }
-}
-
-/**
- * Block statement...
- * A block consists of many such block statements.....
- *
- */
-void BlockStatement(IXMLElement element ):
-{
- boolean isFinal = false;
- IXMLElement temp;
-}
-{
- (
- LOOKAHEAD([ "final" ] Type() <IDENTIFIER>)
- LocalVariableDeclaration(element) ";"
- |
- temp=Statement()
- {
- if (temp!=null)
- element.addChild(temp);
- }
- |
- ClassOrInterfaceDeclaration(0)
- )
-
-}
-
-void LocalVariableDeclaration(IXMLElement element):
-{
- IXMLElement temp;
- boolean isFinal=false;
- IXMLElement type;
-}
-{
- [ "final"
- {
- isFinal = true;
- }
- ]
- type=Type()
- {
- temp=new XMLElement();
- temp.setName("local-variable");
- temp.addChild(XMLHelper.createCopy(type));
- if (isFinal){
- temp.setAttribute("final","true");
- }
- }
- VariableDeclarator(temp)
- {
- element.addChild(temp);
- }
- ( ","
- {
- temp = new XMLElement();
- temp.setName("local-variable");
- temp.addChild(XMLHelper.createCopy(type));
- if (isFinal){
- temp.setAttribute("final","true");
- }
- temp.setAttribute("continued","true");
- }
- VariableDeclarator(temp)
- {
- element.addChild(temp);
- }
-
- )*
-}
-
-IXMLElement EmptyStatement():
-{
- IXMLElement emptyElem = new XMLElement();
- emptyElem.setName("empty");
-}
-{
- ";"
- {
- return emptyElem;
- }
-}
-
-IXMLElement StatementExpression():
-/*
- * The last expansion of this production accepts more than the legal
- * Java expansions for StatementExpression. This expansion does not
- * use PostfixExpression for performance reasons.
- */
-{
- IXMLElement statementExpressionElem=null;
- IXMLElement temp=null;
- String operator=null;
- IXMLElement rightExpr = null;
-
-}
-{
- (
- statementExpressionElem=PreIncrementExpression()
-|
- statementExpressionElem=PreDecrementExpression()
-|
- temp=PrimaryExpression()
- [
- "++"{
- statementExpressionElem = new XMLElement();
- statementExpressionElem.setName("unary-expr");
- statementExpressionElem.setAttribute("op","++");
- statementExpressionElem.setAttribute("post","true");
- statementExpressionElem.addChild(temp);
- }
- |
- "--"{
- statementExpressionElem = new XMLElement();
- statementExpressionElem.setName("unary-expr");
- statementExpressionElem.setAttribute("op","--");
- statementExpressionElem.setAttribute("post","true");
- statementExpressionElem.addChild(temp);
- }
- |
- operator=AssignmentOperator() rightExpr=Expression()
- {
- statementExpressionElem = new XMLElement();
- statementExpressionElem.setName("assignment-expr");
- statementExpressionElem.setAttribute("op",operator);
- IXMLElement lvalueElem = new XMLElement();
- lvalueElem.setName("lvalue");
- lvalueElem.addChild(temp);
- statementExpressionElem.addChild(lvalueElem);
- statementExpressionElem.addChild(rightExpr);
- }
- ]
- )
- {
- if (statementExpressionElem==null)
- statementExpressionElem = temp;
- return statementExpressionElem;
- }
-}
-
-/**
- * <!ELEMENT switch ((%expr-elems;),switch-block+)>
- * <!ELEMENT switch-block ((case|default-case)+,(%stmt-elems;)*)>
- * <!ELEMENT case (%expr-elems;)>
- * <!ELEMENT default-case EMPTY>
- */
-IXMLElement SwitchStatement():
-{
- IXMLElement switchElem = new XMLElement();
- switchElem.setName("switch");
- IXMLElement exprElem;
-
-}
-{
- (
- "switch" "(" exprElem=Expression() ")" "{"
- {
- switchElem.addChild(exprElem); // On ajoute l'expression dans le switch
- System.out.println(exprElem.getAttribute("name"));
- }
- (
- {
- IXMLElement switchBlockElem = new XMLElement();
- switchBlockElem.setName("switch-block"); // On ajoute un Switch block qui contient le case, et le bordel
-
- // On ajoute un block pour le block des switch afin d'être propre, sinon c'est l'auberge espagnole !
- IXMLElement switchBlockInterne = new XMLElement();
- switchBlockInterne.setName("block");
- switchElem.addChild(switchBlockElem);
-
- IXMLElement caseElem;
- }
-
- caseElem=SwitchLabel()
- {
- switchBlockElem.addChild(caseElem);
- // On créé la balise block...
- //switchBlockElem.addChild(switchBlockInterne);
- }
- ( BlockStatement(switchBlockInterne) )*
- {
- // on y colle le foutoir...
- switchBlockElem.addChild(switchBlockInterne);
- }
- )*
- "}"
- )
- {
- return switchElem;
- }
-}
-
-IXMLElement SwitchLabel():
-{
- IXMLElement caseElem = new XMLElement();
- IXMLElement temp;
-}
-{
- (
- "case" temp=Expression() ":"
- {
- caseElem.setName("case");
- caseElem.addChild(temp);
- System.out.println(temp.getAttributeCount());
- }
-|
- "default" ":"
-{
- caseElem.setName("default-case");
-}
- )
- {
- return caseElem;
- }
-}
-
-/**
- *<!ELEMENT if (test,true-case,false-case?)>
- */
-IXMLElement IfStatement():
-/*
- * The disambiguating algorithm of JavaCC automatically binds dangling
- * else's to the innermost if statement. The LOOKAHEAD specification
- * is to tell JavaCC that we know what we are doing.
- */
-{
- IXMLElement ifElem = new XMLElement();
- IXMLElement temp;
- ifElem.setName("if");
-}
-{
- (
- "if" "(" temp=Expression()
- {
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp);
- ifElem.addChild(testElem);
- }
- ")" temp=Statement()
- {
- IXMLElement trueElem = new XMLElement();
- trueElem.setName("true-case");
- trueElem.addChild(temp);
- ifElem.addChild(trueElem);
- }
- [ LOOKAHEAD(1) "else" temp=Statement()
- {
- IXMLElement falseElem = new XMLElement();
- falseElem.setName("false-case");
- falseElem.addChild(temp);
- ifElem.addChild(falseElem);
- }
-
- ]
- )
- {
- return ifElem;
- }
-}
-
-/**
- *<!ELEMENT loop (init*,test?,update*,(%stmt-elems;)?)>
- * <!ATTLIST loop
- * kind (for|while|do) #REQUIRED
- * %location-info;>
- *<!ELEMENT init (local-variable|%expr-elems;)*>
- *<!ELEMENT update (%expr-elems;)>
- *
- *
- */
-IXMLElement WhileStatement():
-{
- IXMLElement loopElem = new XMLElement();
- loopElem.setName("loop");
- loopElem.setAttribute("kind","while");
- IXMLElement temp;
-}
-{
- (
- "while" "(" temp=Expression()
- {
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp);
- loopElem.addChild(testElem);
- }
-
-
- ")" temp=Statement()
- {
- loopElem.addChild(temp);
- }
- )
- {
- return loopElem;
- }
-}
-
-IXMLElement DoStatement():
-{
- IXMLElement loopElem = new XMLElement();
- loopElem.setName("loop");
- loopElem.setAttribute("kind","do");
- IXMLElement temp1;
- IXMLElement temp2;
-}
-{
-
- "do" temp1=Statement()
- "while" "(" temp2=Expression() ")" ";"
- {
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp2);
- loopElem.addChild(testElem);
- loopElem.addChild(temp1);
- return loopElem;
- }
-}
-
-IXMLElement ForStatement():
-{
- IXMLElement loopElem = new XMLElement();
- loopElem.setName("loop");
- loopElem.setAttribute("kind","for");
- IXMLElement temp;
-}
-{
- "for" "("
- (
- LOOKAHEAD(Type() <IDENTIFIER> ":")
- Type() <IDENTIFIER> ":" Expression()
- |
- [ temp=ForInit(){loopElem.addChild(temp);} ] ";"
- [ temp=Expression()
- {
- IXMLElement testElem = new XMLElement();
- testElem.setName("test");
- testElem.addChild(temp);
- loopElem.addChild(testElem);
- }
- ] ";"
- [ temp=ForUpdate() {loopElem.addChild(temp);}]
- )
-
- ")" temp=Statement()
- {
- loopElem.addChild(temp);
- return loopElem;
- }
-
-}
-
-IXMLElement ForInit():
-{
- IXMLElement initElem = new XMLElement();
- initElem.setName("init");
-}
-{
- (
- LOOKAHEAD( [ "final" ] Type() <IDENTIFIER> )
- LocalVariableDeclaration(initElem)
-|
- StatementExpressionList(initElem)
- )
- {
- return initElem;
- }
-}
-
-void StatementExpressionList(IXMLElement element):
-{
- IXMLElement temp;
-}
-{
- temp=StatementExpression()
- {
- element.addChild(temp);
- }
- ( "," temp=StatementExpression()
- {
- element.addChild(temp);
- }
- )*
-}
-
-IXMLElement ForUpdate():
-{
- IXMLElement updateElem = new XMLElement();
- updateElem.setName("update");
-
-}
-{
- StatementExpressionList(updateElem)
- {
- return updateElem;
- }
-}
-
-/*
-<!ELEMENT break EMPTY>
-<!ATTLIST break
- targetname CDATA #IMPLIED>
- */
-IXMLElement BreakStatement():
-{
- IXMLElement breakElem = new XMLElement();
- breakElem.setName("break");
- Token t;
-}
-{
- "break" [ t=<IDENTIFIER> {breakElem.setAttribute("targetname",t.image);}] ";"
- {
- return breakElem;
- }
-}
-/*
-<!ELEMENT continue EMPTY>
-<!ATTLIST continue
- targetname CDATA #IMPLIED>
-*/
-IXMLElement ContinueStatement():
-{
- IXMLElement continueElem = new XMLElement();
- continueElem.setName("continue");
- Token t;
-}
-{
- "continue" [ t=<IDENTIFIER>{continueElem.setAttribute("targetname",t.image);} ] ";"
- {
- return continueElem;
- }
-}
-
-/*
-<!ELEMENT return (%expr-elems;)?>
-*/
-
-IXMLElement ReturnStatement():
-{
- IXMLElement returnElem = new XMLElement();
- returnElem.setName("return");
- IXMLElement exprElem;
-}
-{
- "return" [ exprElem=Expression(){returnElem.addChild(exprElem);} ] ";"
- {
- return returnElem;
- }
-}
-
-/*
-<!ELEMENT throw (%expr-elems;)>
- */
-IXMLElement ThrowStatement():
-{
- IXMLElement throwElem = new XMLElement();
- throwElem.setName("throw");
- IXMLElement exprElem;
-}
-{
- "throw" exprElem=Expression() ";"
- {
- throwElem.addChild(exprElem);
- return throwElem;
- }
-}
-
-/*
- <!ELEMENT synchronized (expr,block)>
-<!ELEMENT expr (%expr-elems;)>
- */
-IXMLElement SynchronizedStatement():
-{
- IXMLElement syncElem = new XMLElement();
- syncElem.setName("synchronized");
- IXMLElement temp;
-}
-{
- "synchronized"
- "(" temp=Expression()
- {
- IXMLElement exprElem = new XMLElement();
- exprElem.setName("expr");
- exprElem.addChild(temp);
- syncElem.addChild(exprElem);
- }
- ")"
- temp=Block()
- {
- syncElem.addChild(temp);
- return syncElem;
- }
-
-}
-
-/*
-<!ELEMENT try ((%stmt-elems;),catch*,finally?)>
-<!ELEMENT catch (formal-argument,(%stmt-elems;)?)>
-<!ELEMENT finally (%stmt-elems;)>
-*/
-IXMLElement TryStatement():
-/*
- * Semantic check required here to make sure that at least one
- * finally/catch is present.
- */
-{
- IXMLElement tryElem = new XMLElement();
- tryElem.setName("try");
- IXMLElement temp;
-}
-{
- "try" temp=Block()
- {
- tryElem.addChild(temp);
- }
- (
- {
- IXMLElement catchElem = new XMLElement();
- catchElem.setName("catch");
- }
-
- "catch" "(" temp=FormalParameter() {catchElem.addChild(temp);} ")"
- temp=Block()
- {
- catchElem.addChild(temp);
- tryElem.addChild(catchElem);
- }
- )*
- [
- {
- IXMLElement finallyElem = new XMLElement();
- finallyElem.setName("finally");
- }
- "finally" temp=Block()
- {
- finallyElem.addChild(temp);
- tryElem.addChild(finallyElem);
- }
- ]
- {
- if (tryElem.getChildrenCount()==0)
- throw new ParseException("try should end with atleast one catch or one finally");
- return tryElem;
- }
-}
-
-/* We use productions to match >>>, >> and > so that we can keep the
- * type declaration syntax with generics clean
- */
-
-String RUNSIGNEDSHIFT():
-{}
-{
- ( LOOKAHEAD({ getToken(1).kind == GT &&
- ((Token.GTToken)getToken(1)).realKind == RUNSIGNEDSHIFT} )
- ">" ">" ">"
- )
- {
- return ">>>";
- }
-}
-
-String RSIGNEDSHIFT():
-{}
-{
- ( LOOKAHEAD({ getToken(1).kind == GT &&
- ((Token.GTToken)getToken(1)).realKind == RSIGNEDSHIFT} )
- ">" ">"
- )
- {
- return ">>";
- }
-}
-
-/* Annotation syntax follows. */
-
-void Annotation():
-{}
-{
- LOOKAHEAD( "@" Name() "(" ( <IDENTIFIER> "=" | ")" ))
- NormalAnnotation()
- |
- LOOKAHEAD( "@" Name() "(" )
- SingleMemberAnnotation()
- |
- MarkerAnnotation()
-}
-
-void NormalAnnotation():
-{}
-{
- "@" Name() "(" [ MemberValuePairs() ] ")"
-}
-
-void MarkerAnnotation():
-{}
-{
- "@" Name()
-}
-
-void SingleMemberAnnotation():
-{}
-{
- "@" Name() "(" MemberValue() ")"
-}
-
-void MemberValuePairs():
-{}
-{
- MemberValuePair() ( "," MemberValuePair() )*
-}
-
-void MemberValuePair():
-{}
-{
- <IDENTIFIER> "=" MemberValue()
-}
-
-void MemberValue():
-{}
-{
- Annotation()
- |
- MemberValueArrayInitializer()
- |
- ConditionalExpression()
-}
-
-void MemberValueArrayInitializer():
-{}
-{
- "{" MemberValue() ( LOOKAHEAD(2) "," MemberValue() )* [ "," ] "}"
-}
-
-/*
- *
- *
- */
-/* Annotation Types. */
-
-void AnnotationTypeDeclaration(int modifiers):
-{}
-{
- "@" "interface" <IDENTIFIER> AnnotationTypeBody()
-}
-
-void AnnotationTypeBody():
-{}
-{
- "{" ( AnnotationTypeMemberDeclaration() )* "}"
-}
-
-void AnnotationTypeMemberDeclaration():
-{
- int modifiers;
-}
-{
- modifiers = Modifiers()
- (
- LOOKAHEAD(Type() <IDENTIFIER> "(")
- Type() <IDENTIFIER> "(" ")" [ DefaultValue() ] ";"
- |
- ClassOrInterfaceDeclaration(modifiers)
- |
- EnumDeclaration(modifiers)
- |
- AnnotationTypeDeclaration(modifiers)
- |
- FieldDeclaration(modifiers,null)
- )
- |
- ( ";" )
-}
-
-void DefaultValue():
-{}
-{
- "default" MemberValue()
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserConstants.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserConstants.class
deleted file mode 100644
index 7fe78b5..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserConstants.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserConstants.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserConstants.java
deleted file mode 100644
index 1d1b69a..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserConstants.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. JavaParserConstants.java */
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-
-
-/**
- * Token literal values and constants.
- * Generated by org.javacc.parser.OtherFilesGen#start()
- */
-public interface JavaParserConstants {
-
- /** End of File. */
- int EOF = 0;
- /** RegularExpression Id. */
- int SINGLE_LINE_COMMENT = 9;
- /** RegularExpression Id. */
- int FORMAL_COMMENT = 10;
- /** RegularExpression Id. */
- int MULTI_LINE_COMMENT = 11;
- /** RegularExpression Id. */
- int ABSTRACT = 13;
- /** RegularExpression Id. */
- int ASSERT = 14;
- /** RegularExpression Id. */
- int BOOLEAN = 15;
- /** RegularExpression Id. */
- int BREAK = 16;
- /** RegularExpression Id. */
- int BYTE = 17;
- /** RegularExpression Id. */
- int CASE = 18;
- /** RegularExpression Id. */
- int CATCH = 19;
- /** RegularExpression Id. */
- int CHAR = 20;
- /** RegularExpression Id. */
- int CLASS = 21;
- /** RegularExpression Id. */
- int CONST = 22;
- /** RegularExpression Id. */
- int CONTINUE = 23;
- /** RegularExpression Id. */
- int _DEFAULT = 24;
- /** RegularExpression Id. */
- int DO = 25;
- /** RegularExpression Id. */
- int DOUBLE = 26;
- /** RegularExpression Id. */
- int ELSE = 27;
- /** RegularExpression Id. */
- int ENUM = 28;
- /** RegularExpression Id. */
- int EXTENDS = 29;
- /** RegularExpression Id. */
- int FALSE = 30;
- /** RegularExpression Id. */
- int FINAL = 31;
- /** RegularExpression Id. */
- int FINALLY = 32;
- /** RegularExpression Id. */
- int FLOAT = 33;
- /** RegularExpression Id. */
- int FOR = 34;
- /** RegularExpression Id. */
- int GOTO = 35;
- /** RegularExpression Id. */
- int IF = 36;
- /** RegularExpression Id. */
- int IMPLEMENTS = 37;
- /** RegularExpression Id. */
- int IMPORT = 38;
- /** RegularExpression Id. */
- int INSTANCEOF = 39;
- /** RegularExpression Id. */
- int INT = 40;
- /** RegularExpression Id. */
- int INTERFACE = 41;
- /** RegularExpression Id. */
- int LONG = 42;
- /** RegularExpression Id. */
- int NATIVE = 43;
- /** RegularExpression Id. */
- int NEW = 44;
- /** RegularExpression Id. */
- int NULL = 45;
- /** RegularExpression Id. */
- int PACKAGE = 46;
- /** RegularExpression Id. */
- int PRIVATE = 47;
- /** RegularExpression Id. */
- int PROTECTED = 48;
- /** RegularExpression Id. */
- int PUBLIC = 49;
- /** RegularExpression Id. */
- int RETURN = 50;
- /** RegularExpression Id. */
- int SHORT = 51;
- /** RegularExpression Id. */
- int STATIC = 52;
- /** RegularExpression Id. */
- int STRICTFP = 53;
- /** RegularExpression Id. */
- int SUPER = 54;
- /** RegularExpression Id. */
- int SWITCH = 55;
- /** RegularExpression Id. */
- int SYNCHRONIZED = 56;
- /** RegularExpression Id. */
- int THIS = 57;
- /** RegularExpression Id. */
- int THROW = 58;
- /** RegularExpression Id. */
- int THROWS = 59;
- /** RegularExpression Id. */
- int TRANSIENT = 60;
- /** RegularExpression Id. */
- int TRUE = 61;
- /** RegularExpression Id. */
- int TRY = 62;
- /** RegularExpression Id. */
- int VOID = 63;
- /** RegularExpression Id. */
- int VOLATILE = 64;
- /** RegularExpression Id. */
- int WHILE = 65;
- /** RegularExpression Id. */
- int INTEGER_LITERAL = 66;
- /** RegularExpression Id. */
- int DECIMAL_LITERAL = 67;
- /** RegularExpression Id. */
- int HEX_LITERAL = 68;
- /** RegularExpression Id. */
- int OCTAL_LITERAL = 69;
- /** RegularExpression Id. */
- int FLOATING_POINT_LITERAL = 70;
- /** RegularExpression Id. */
- int EXPONENT = 71;
- /** RegularExpression Id. */
- int CHARACTER_LITERAL = 72;
- /** RegularExpression Id. */
- int STRING_LITERAL = 73;
- /** RegularExpression Id. */
- int IDENTIFIER = 74;
- /** RegularExpression Id. */
- int LETTER = 75;
- /** RegularExpression Id. */
- int DIGIT = 76;
- /** RegularExpression Id. */
- int LPAREN = 77;
- /** RegularExpression Id. */
- int RPAREN = 78;
- /** RegularExpression Id. */
- int LBRACE = 79;
- /** RegularExpression Id. */
- int RBRACE = 80;
- /** RegularExpression Id. */
- int LBRACKET = 81;
- /** RegularExpression Id. */
- int RBRACKET = 82;
- /** RegularExpression Id. */
- int SEMICOLON = 83;
- /** RegularExpression Id. */
- int COMMA = 84;
- /** RegularExpression Id. */
- int DOT = 85;
- /** RegularExpression Id. */
- int AT = 86;
- /** RegularExpression Id. */
- int ASSIGN = 87;
- /** RegularExpression Id. */
- int LT = 88;
- /** RegularExpression Id. */
- int BANG = 89;
- /** RegularExpression Id. */
- int TILDE = 90;
- /** RegularExpression Id. */
- int HOOK = 91;
- /** RegularExpression Id. */
- int COLON = 92;
- /** RegularExpression Id. */
- int EQ = 93;
- /** RegularExpression Id. */
- int LE = 94;
- /** RegularExpression Id. */
- int GE = 95;
- /** RegularExpression Id. */
- int NE = 96;
- /** RegularExpression Id. */
- int SC_OR = 97;
- /** RegularExpression Id. */
- int SC_AND = 98;
- /** RegularExpression Id. */
- int INCR = 99;
- /** RegularExpression Id. */
- int DECR = 100;
- /** RegularExpression Id. */
- int PLUS = 101;
- /** RegularExpression Id. */
- int MINUS = 102;
- /** RegularExpression Id. */
- int STAR = 103;
- /** RegularExpression Id. */
- int SLASH = 104;
- /** RegularExpression Id. */
- int BIT_AND = 105;
- /** RegularExpression Id. */
- int BIT_OR = 106;
- /** RegularExpression Id. */
- int XOR = 107;
- /** RegularExpression Id. */
- int REM = 108;
- /** RegularExpression Id. */
- int LSHIFT = 109;
- /** RegularExpression Id. */
- int PLUSASSIGN = 110;
- /** RegularExpression Id. */
- int MINUSASSIGN = 111;
- /** RegularExpression Id. */
- int STARASSIGN = 112;
- /** RegularExpression Id. */
- int SLASHASSIGN = 113;
- /** RegularExpression Id. */
- int ANDASSIGN = 114;
- /** RegularExpression Id. */
- int ORASSIGN = 115;
- /** RegularExpression Id. */
- int XORASSIGN = 116;
- /** RegularExpression Id. */
- int REMASSIGN = 117;
- /** RegularExpression Id. */
- int LSHIFTASSIGN = 118;
- /** RegularExpression Id. */
- int RSIGNEDSHIFTASSIGN = 119;
- /** RegularExpression Id. */
- int RUNSIGNEDSHIFTASSIGN = 120;
- /** RegularExpression Id. */
- int ELLIPSIS = 121;
- /** RegularExpression Id. */
- int RUNSIGNEDSHIFT = 122;
- /** RegularExpression Id. */
- int RSIGNEDSHIFT = 123;
- /** RegularExpression Id. */
- int GT = 124;
-
- /** Lexical state. */
- int DEFAULT = 0;
- /** Lexical state. */
- int IN_SINGLE_LINE_COMMENT = 1;
- /** Lexical state. */
- int IN_FORMAL_COMMENT = 2;
- /** Lexical state. */
- int IN_MULTI_LINE_COMMENT = 3;
-
- /** Literal token values. */
- String[] tokenImage = {
- "<EOF>",
- "\" \"",
- "\"\\t\"",
- "\"\\n\"",
- "\"\\r\"",
- "\"\\f\"",
- "\"//\"",
- "<token of kind 7>",
- "\"/*\"",
- "<SINGLE_LINE_COMMENT>",
- "\"*/\"",
- "\"*/\"",
- "<token of kind 12>",
- "\"abstract\"",
- "\"assert\"",
- "\"boolean\"",
- "\"break\"",
- "\"byte\"",
- "\"case\"",
- "\"catch\"",
- "\"char\"",
- "\"class\"",
- "\"const\"",
- "\"continue\"",
- "\"default\"",
- "\"do\"",
- "\"double\"",
- "\"else\"",
- "\"enum\"",
- "\"extends\"",
- "\"false\"",
- "\"final\"",
- "\"finally\"",
- "\"float\"",
- "\"for\"",
- "\"goto\"",
- "\"if\"",
- "\"implements\"",
- "\"import\"",
- "\"instanceof\"",
- "\"int\"",
- "\"interface\"",
- "\"long\"",
- "\"native\"",
- "\"new\"",
- "\"null\"",
- "\"package\"",
- "\"private\"",
- "\"protected\"",
- "\"public\"",
- "\"return\"",
- "\"short\"",
- "\"static\"",
- "\"strictfp\"",
- "\"super\"",
- "\"switch\"",
- "\"synchronized\"",
- "\"this\"",
- "\"throw\"",
- "\"throws\"",
- "\"transient\"",
- "\"true\"",
- "\"try\"",
- "\"void\"",
- "\"volatile\"",
- "\"while\"",
- "<INTEGER_LITERAL>",
- "<DECIMAL_LITERAL>",
- "<HEX_LITERAL>",
- "<OCTAL_LITERAL>",
- "<FLOATING_POINT_LITERAL>",
- "<EXPONENT>",
- "<CHARACTER_LITERAL>",
- "<STRING_LITERAL>",
- "<IDENTIFIER>",
- "<LETTER>",
- "<DIGIT>",
- "\"(\"",
- "\")\"",
- "\"{\"",
- "\"}\"",
- "\"[\"",
- "\"]\"",
- "\";\"",
- "\",\"",
- "\".\"",
- "\"@\"",
- "\"=\"",
- "\"<\"",
- "\"!\"",
- "\"~\"",
- "\"?\"",
- "\":\"",
- "\"==\"",
- "\"<=\"",
- "\">=\"",
- "\"!=\"",
- "\"||\"",
- "\"&&\"",
- "\"++\"",
- "\"--\"",
- "\"+\"",
- "\"-\"",
- "\"*\"",
- "\"/\"",
- "\"&\"",
- "\"|\"",
- "\"^\"",
- "\"%\"",
- "\"<<\"",
- "\"+=\"",
- "\"-=\"",
- "\"*=\"",
- "\"/=\"",
- "\"&=\"",
- "\"|=\"",
- "\"^=\"",
- "\"%=\"",
- "\"<<=\"",
- "\">>=\"",
- "\">>>=\"",
- "\"...\"",
- "\">>>\"",
- "\">>\"",
- "\">\"",
- };
-
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserTokenManager.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserTokenManager.class
deleted file mode 100644
index 8591e25..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserTokenManager.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserTokenManager.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserTokenManager.java
deleted file mode 100644
index c08fe88..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/JavaParserTokenManager.java
+++ /dev/null
@@ -1,1815 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. JavaParserTokenManager.java */
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-import harsh.javatoxml.XMLHelper;
-import harsh.javatoxml.Exceptions.*;
-import java.io.*;
-import java.util.LinkedList;
-import java.util.Iterator;
-import harsh.javatoxml.data.*;
-
-/** Token Manager. */
-public class JavaParserTokenManager implements JavaParserConstants
-{
-
- /** Debug output. */
- public java.io.PrintStream debugStream = System.out;
- /** Set debug output. */
- public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
-private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
-{
- switch (pos)
- {
- case 0:
- if ((active0 & 0x140L) != 0L || (active1 & 0x2010000000000L) != 0L)
- return 2;
- if ((active1 & 0x200000000200000L) != 0L)
- return 8;
- if ((active0 & 0xffffffffffffe000L) != 0L || (active1 & 0x3L) != 0L)
- {
- jjmatchedKind = 74;
- return 32;
- }
- return -1;
- case 1:
- if ((active0 & 0x100L) != 0L)
- return 0;
- if ((active0 & 0xffffffeff9ffe000L) != 0L || (active1 & 0x3L) != 0L)
- {
- if (jjmatchedPos != 1)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 1;
- }
- return 32;
- }
- if ((active0 & 0x1006000000L) != 0L)
- return 32;
- return -1;
- case 2:
- if ((active0 & 0xbfffecebfdffe000L) != 0L || (active1 & 0x3L) != 0L)
- {
- if (jjmatchedPos != 2)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 2;
- }
- return 32;
- }
- if ((active0 & 0x4000130400000000L) != 0L)
- return 32;
- return -1;
- case 3:
- if ((active0 & 0x1dffcae3e5e9e000L) != 0L || (active1 & 0x3L) != 0L)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 3;
- return 32;
- }
- if ((active0 & 0xa200240818160000L) != 0L)
- return 32;
- return -1;
- case 4:
- if ((active0 & 0x11b7cae02580e000L) != 0L || (active1 & 0x1L) != 0L)
- {
- if (jjmatchedPos != 4)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 4;
- }
- return 32;
- }
- if ((active0 & 0xc480003c0690000L) != 0L || (active1 & 0x2L) != 0L)
- return 32;
- return -1;
- case 5:
- if ((active0 & 0x1121c2a12180a000L) != 0L || (active1 & 0x1L) != 0L)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 5;
- return 32;
- }
- if ((active0 & 0x896084004004000L) != 0L)
- return 32;
- return -1;
- case 6:
- if ((active0 & 0x112102a000802000L) != 0L || (active1 & 0x1L) != 0L)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 6;
- return 32;
- }
- if ((active0 & 0xc00121008000L) != 0L)
- return 32;
- return -1;
- case 7:
- if ((active0 & 0x110102a000000000L) != 0L)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 7;
- return 32;
- }
- if ((active0 & 0x20000000802000L) != 0L || (active1 & 0x1L) != 0L)
- return 32;
- return -1;
- case 8:
- if ((active0 & 0x10000a000000000L) != 0L)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 8;
- return 32;
- }
- if ((active0 & 0x1001020000000000L) != 0L)
- return 32;
- return -1;
- case 9:
- if ((active0 & 0x100000000000000L) != 0L)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 9;
- return 32;
- }
- if ((active0 & 0xa000000000L) != 0L)
- return 32;
- return -1;
- case 10:
- if ((active0 & 0x100000000000000L) != 0L)
- {
- jjmatchedKind = 74;
- jjmatchedPos = 10;
- return 32;
- }
- return -1;
- default :
- return -1;
- }
-}
-private final int jjStartNfa_0(int pos, long active0, long active1)
-{
- return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);
-}
-private int jjStopAtPos(int pos, int kind)
-{
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- return pos + 1;
-}
-private int jjMoveStringLiteralDfa0_0()
-{
- switch(curChar)
- {
- case 33:
- jjmatchedKind = 89;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000L);
- case 37:
- jjmatchedKind = 108;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x20000000000000L);
- case 38:
- jjmatchedKind = 105;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x4000400000000L);
- case 40:
- return jjStopAtPos(0, 77);
- case 41:
- return jjStopAtPos(0, 78);
- case 42:
- jjmatchedKind = 103;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x1000000000000L);
- case 43:
- jjmatchedKind = 101;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x400800000000L);
- case 44:
- return jjStopAtPos(0, 84);
- case 45:
- jjmatchedKind = 102;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x801000000000L);
- case 46:
- jjmatchedKind = 85;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x200000000000000L);
- case 47:
- jjmatchedKind = 104;
- return jjMoveStringLiteralDfa1_0(0x140L, 0x2000000000000L);
- case 58:
- return jjStopAtPos(0, 92);
- case 59:
- return jjStopAtPos(0, 83);
- case 60:
- jjmatchedKind = 88;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x40200040000000L);
- case 61:
- jjmatchedKind = 87;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x20000000L);
- case 62:
- jjmatchedKind = 124;
- return jjMoveStringLiteralDfa1_0(0x0L, 0xd80000080000000L);
- case 63:
- return jjStopAtPos(0, 91);
- case 64:
- return jjStopAtPos(0, 86);
- case 91:
- return jjStopAtPos(0, 81);
- case 93:
- return jjStopAtPos(0, 82);
- case 94:
- jjmatchedKind = 107;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x10000000000000L);
- case 97:
- return jjMoveStringLiteralDfa1_0(0x6000L, 0x0L);
- case 98:
- return jjMoveStringLiteralDfa1_0(0x38000L, 0x0L);
- case 99:
- return jjMoveStringLiteralDfa1_0(0xfc0000L, 0x0L);
- case 100:
- return jjMoveStringLiteralDfa1_0(0x7000000L, 0x0L);
- case 101:
- return jjMoveStringLiteralDfa1_0(0x38000000L, 0x0L);
- case 102:
- return jjMoveStringLiteralDfa1_0(0x7c0000000L, 0x0L);
- case 103:
- return jjMoveStringLiteralDfa1_0(0x800000000L, 0x0L);
- case 105:
- return jjMoveStringLiteralDfa1_0(0x3f000000000L, 0x0L);
- case 108:
- return jjMoveStringLiteralDfa1_0(0x40000000000L, 0x0L);
- case 110:
- return jjMoveStringLiteralDfa1_0(0x380000000000L, 0x0L);
- case 112:
- return jjMoveStringLiteralDfa1_0(0x3c00000000000L, 0x0L);
- case 114:
- return jjMoveStringLiteralDfa1_0(0x4000000000000L, 0x0L);
- case 115:
- return jjMoveStringLiteralDfa1_0(0x1f8000000000000L, 0x0L);
- case 116:
- return jjMoveStringLiteralDfa1_0(0x7e00000000000000L, 0x0L);
- case 118:
- return jjMoveStringLiteralDfa1_0(0x8000000000000000L, 0x1L);
- case 119:
- return jjMoveStringLiteralDfa1_0(0x0L, 0x2L);
- case 123:
- return jjStopAtPos(0, 79);
- case 124:
- jjmatchedKind = 106;
- return jjMoveStringLiteralDfa1_0(0x0L, 0x8000200000000L);
- case 125:
- return jjStopAtPos(0, 80);
- case 126:
- return jjStopAtPos(0, 90);
- default :
- return jjMoveNfa_0(3, 0);
- }
-}
-private int jjMoveStringLiteralDfa1_0(long active0, long active1)
-{
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(0, active0, active1);
- return 1;
- }
- switch(curChar)
- {
- case 38:
- if ((active1 & 0x400000000L) != 0L)
- return jjStopAtPos(1, 98);
- break;
- case 42:
- if ((active0 & 0x100L) != 0L)
- return jjStartNfaWithStates_0(1, 8, 0);
- break;
- case 43:
- if ((active1 & 0x800000000L) != 0L)
- return jjStopAtPos(1, 99);
- break;
- case 45:
- if ((active1 & 0x1000000000L) != 0L)
- return jjStopAtPos(1, 100);
- break;
- case 46:
- return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x200000000000000L);
- case 47:
- if ((active0 & 0x40L) != 0L)
- return jjStopAtPos(1, 6);
- break;
- case 60:
- if ((active1 & 0x200000000000L) != 0L)
- {
- jjmatchedKind = 109;
- jjmatchedPos = 1;
- }
- return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x40000000000000L);
- case 61:
- if ((active1 & 0x20000000L) != 0L)
- return jjStopAtPos(1, 93);
- else if ((active1 & 0x40000000L) != 0L)
- return jjStopAtPos(1, 94);
- else if ((active1 & 0x80000000L) != 0L)
- return jjStopAtPos(1, 95);
- else if ((active1 & 0x100000000L) != 0L)
- return jjStopAtPos(1, 96);
- else if ((active1 & 0x400000000000L) != 0L)
- return jjStopAtPos(1, 110);
- else if ((active1 & 0x800000000000L) != 0L)
- return jjStopAtPos(1, 111);
- else if ((active1 & 0x1000000000000L) != 0L)
- return jjStopAtPos(1, 112);
- else if ((active1 & 0x2000000000000L) != 0L)
- return jjStopAtPos(1, 113);
- else if ((active1 & 0x4000000000000L) != 0L)
- return jjStopAtPos(1, 114);
- else if ((active1 & 0x8000000000000L) != 0L)
- return jjStopAtPos(1, 115);
- else if ((active1 & 0x10000000000000L) != 0L)
- return jjStopAtPos(1, 116);
- else if ((active1 & 0x20000000000000L) != 0L)
- return jjStopAtPos(1, 117);
- break;
- case 62:
- if ((active1 & 0x800000000000000L) != 0L)
- {
- jjmatchedKind = 123;
- jjmatchedPos = 1;
- }
- return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x580000000000000L);
- case 97:
- return jjMoveStringLiteralDfa2_0(active0, 0x4800400c0000L, active1, 0L);
- case 98:
- return jjMoveStringLiteralDfa2_0(active0, 0x2000L, active1, 0L);
- case 101:
- return jjMoveStringLiteralDfa2_0(active0, 0x4100001000000L, active1, 0L);
- case 102:
- if ((active0 & 0x1000000000L) != 0L)
- return jjStartNfaWithStates_0(1, 36, 32);
- break;
- case 104:
- return jjMoveStringLiteralDfa2_0(active0, 0xe08000000100000L, active1, 0x2L);
- case 105:
- return jjMoveStringLiteralDfa2_0(active0, 0x180000000L, active1, 0L);
- case 108:
- return jjMoveStringLiteralDfa2_0(active0, 0x208200000L, active1, 0L);
- case 109:
- return jjMoveStringLiteralDfa2_0(active0, 0x6000000000L, active1, 0L);
- case 110:
- return jjMoveStringLiteralDfa2_0(active0, 0x38010000000L, active1, 0L);
- case 111:
- if ((active0 & 0x2000000L) != 0L)
- {
- jjmatchedKind = 25;
- jjmatchedPos = 1;
- }
- return jjMoveStringLiteralDfa2_0(active0, 0x8000040c04c08000L, active1, 0x1L);
- case 114:
- return jjMoveStringLiteralDfa2_0(active0, 0x7001800000010000L, active1, 0L);
- case 115:
- return jjMoveStringLiteralDfa2_0(active0, 0x4000L, active1, 0L);
- case 116:
- return jjMoveStringLiteralDfa2_0(active0, 0x30000000000000L, active1, 0L);
- case 117:
- return jjMoveStringLiteralDfa2_0(active0, 0x42200000000000L, active1, 0L);
- case 119:
- return jjMoveStringLiteralDfa2_0(active0, 0x80000000000000L, active1, 0L);
- case 120:
- return jjMoveStringLiteralDfa2_0(active0, 0x20000000L, active1, 0L);
- case 121:
- return jjMoveStringLiteralDfa2_0(active0, 0x100000000020000L, active1, 0L);
- case 124:
- if ((active1 & 0x200000000L) != 0L)
- return jjStopAtPos(1, 97);
- break;
- default :
- break;
- }
- return jjStartNfa_0(0, active0, active1);
-}
-private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)
-{
- if (((active0 &= old0) | (active1 &= old1)) == 0L)
- return jjStartNfa_0(0, old0, old1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(1, active0, active1);
- return 2;
- }
- switch(curChar)
- {
- case 46:
- if ((active1 & 0x200000000000000L) != 0L)
- return jjStopAtPos(2, 121);
- break;
- case 61:
- if ((active1 & 0x40000000000000L) != 0L)
- return jjStopAtPos(2, 118);
- else if ((active1 & 0x80000000000000L) != 0L)
- return jjStopAtPos(2, 119);
- break;
- case 62:
- if ((active1 & 0x400000000000000L) != 0L)
- {
- jjmatchedKind = 122;
- jjmatchedPos = 2;
- }
- return jjMoveStringLiteralDfa3_0(active0, 0L, active1, 0x100000000000000L);
- case 97:
- return jjMoveStringLiteralDfa3_0(active0, 0x1010000000300000L, active1, 0L);
- case 98:
- return jjMoveStringLiteralDfa3_0(active0, 0x2000000000000L, active1, 0L);
- case 99:
- return jjMoveStringLiteralDfa3_0(active0, 0x400000000000L, active1, 0L);
- case 101:
- return jjMoveStringLiteralDfa3_0(active0, 0x10000L, active1, 0L);
- case 102:
- return jjMoveStringLiteralDfa3_0(active0, 0x1000000L, active1, 0L);
- case 105:
- return jjMoveStringLiteralDfa3_0(active0, 0x8280800000000000L, active1, 0x2L);
- case 108:
- return jjMoveStringLiteralDfa3_0(active0, 0x200040000000L, active1, 0x1L);
- case 110:
- return jjMoveStringLiteralDfa3_0(active0, 0x100040180c00000L, active1, 0L);
- case 111:
- return jjMoveStringLiteralDfa3_0(active0, 0x9000200008000L, active1, 0L);
- case 112:
- return jjMoveStringLiteralDfa3_0(active0, 0x40006000000000L, active1, 0L);
- case 114:
- if ((active0 & 0x400000000L) != 0L)
- return jjStartNfaWithStates_0(2, 34, 32);
- return jjMoveStringLiteralDfa3_0(active0, 0xc20000000000000L, active1, 0L);
- case 115:
- return jjMoveStringLiteralDfa3_0(active0, 0x8008046000L, active1, 0L);
- case 116:
- if ((active0 & 0x10000000000L) != 0L)
- {
- jjmatchedKind = 40;
- jjmatchedPos = 2;
- }
- return jjMoveStringLiteralDfa3_0(active0, 0x40a08200a0000L, active1, 0L);
- case 117:
- return jjMoveStringLiteralDfa3_0(active0, 0x2000000014000000L, active1, 0L);
- case 119:
- if ((active0 & 0x100000000000L) != 0L)
- return jjStartNfaWithStates_0(2, 44, 32);
- break;
- case 121:
- if ((active0 & 0x4000000000000000L) != 0L)
- return jjStartNfaWithStates_0(2, 62, 32);
- break;
- default :
- break;
- }
- return jjStartNfa_0(1, active0, active1);
-}
-private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1)
-{
- if (((active0 &= old0) | (active1 &= old1)) == 0L)
- return jjStartNfa_0(1, old0, old1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(2, active0, active1);
- return 3;
- }
- switch(curChar)
- {
- case 61:
- if ((active1 & 0x100000000000000L) != 0L)
- return jjStopAtPos(3, 120);
- break;
- case 97:
- return jjMoveStringLiteralDfa4_0(active0, 0x381010000L, active1, 0x1L);
- case 98:
- return jjMoveStringLiteralDfa4_0(active0, 0x4000000L, active1, 0L);
- case 99:
- return jjMoveStringLiteralDfa4_0(active0, 0x100000000080000L, active1, 0L);
- case 100:
- if ((active0 & 0x8000000000000000L) != 0L)
- return jjStartNfaWithStates_0(3, 63, 32);
- break;
- case 101:
- if ((active0 & 0x20000L) != 0L)
- return jjStartNfaWithStates_0(3, 17, 32);
- else if ((active0 & 0x40000L) != 0L)
- return jjStartNfaWithStates_0(3, 18, 32);
- else if ((active0 & 0x8000000L) != 0L)
- return jjStartNfaWithStates_0(3, 27, 32);
- else if ((active0 & 0x2000000000000000L) != 0L)
- return jjStartNfaWithStates_0(3, 61, 32);
- return jjMoveStringLiteralDfa4_0(active0, 0x40020020004000L, active1, 0L);
- case 103:
- if ((active0 & 0x40000000000L) != 0L)
- return jjStartNfaWithStates_0(3, 42, 32);
- break;
- case 105:
- return jjMoveStringLiteralDfa4_0(active0, 0x20080000000000L, active1, 0L);
- case 107:
- return jjMoveStringLiteralDfa4_0(active0, 0x400000000000L, active1, 0L);
- case 108:
- if ((active0 & 0x200000000000L) != 0L)
- return jjStartNfaWithStates_0(3, 45, 32);
- return jjMoveStringLiteralDfa4_0(active0, 0x2002000008000L, active1, 0x2L);
- case 109:
- if ((active0 & 0x10000000L) != 0L)
- return jjStartNfaWithStates_0(3, 28, 32);
- break;
- case 110:
- return jjMoveStringLiteralDfa4_0(active0, 0x1000000000000000L, active1, 0L);
- case 111:
- if ((active0 & 0x800000000L) != 0L)
- return jjStartNfaWithStates_0(3, 35, 32);
- return jjMoveStringLiteralDfa4_0(active0, 0xc00004000000000L, active1, 0L);
- case 114:
- if ((active0 & 0x100000L) != 0L)
- return jjStartNfaWithStates_0(3, 20, 32);
- return jjMoveStringLiteralDfa4_0(active0, 0x8000000000000L, active1, 0L);
- case 115:
- if ((active0 & 0x200000000000000L) != 0L)
- return jjStartNfaWithStates_0(3, 57, 32);
- return jjMoveStringLiteralDfa4_0(active0, 0x40600000L, active1, 0L);
- case 116:
- return jjMoveStringLiteralDfa4_0(active0, 0x91008000802000L, active1, 0L);
- case 117:
- return jjMoveStringLiteralDfa4_0(active0, 0x4000000000000L, active1, 0L);
- case 118:
- return jjMoveStringLiteralDfa4_0(active0, 0x800000000000L, active1, 0L);
- default :
- break;
- }
- return jjStartNfa_0(2, active0, active1);
-}
-private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1)
-{
- if (((active0 &= old0) | (active1 &= old1)) == 0L)
- return jjStartNfa_0(2, old0, old1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(3, active0, active1);
- return 4;
- }
- switch(curChar)
- {
- case 97:
- return jjMoveStringLiteralDfa5_0(active0, 0xc08000000000L, active1, 0L);
- case 99:
- return jjMoveStringLiteralDfa5_0(active0, 0xa0000000000000L, active1, 0L);
- case 101:
- if ((active0 & 0x40000000L) != 0L)
- return jjStartNfaWithStates_0(4, 30, 32);
- else if ((active1 & 0x2L) != 0L)
- return jjStartNfaWithStates_0(4, 65, 32);
- return jjMoveStringLiteralDfa5_0(active0, 0x1002000008000L, active1, 0L);
- case 104:
- if ((active0 & 0x80000L) != 0L)
- return jjStartNfaWithStates_0(4, 19, 32);
- return jjMoveStringLiteralDfa5_0(active0, 0x100000000000000L, active1, 0L);
- case 105:
- return jjMoveStringLiteralDfa5_0(active0, 0x12000000800000L, active1, 0L);
- case 107:
- if ((active0 & 0x10000L) != 0L)
- return jjStartNfaWithStates_0(4, 16, 32);
- break;
- case 108:
- if ((active0 & 0x80000000L) != 0L)
- {
- jjmatchedKind = 31;
- jjmatchedPos = 4;
- }
- return jjMoveStringLiteralDfa5_0(active0, 0x104000000L, active1, 0L);
- case 110:
- return jjMoveStringLiteralDfa5_0(active0, 0x20000000L, active1, 0L);
- case 114:
- if ((active0 & 0x40000000000000L) != 0L)
- return jjStartNfaWithStates_0(4, 54, 32);
- return jjMoveStringLiteralDfa5_0(active0, 0x4024000006000L, active1, 0L);
- case 115:
- if ((active0 & 0x200000L) != 0L)
- return jjStartNfaWithStates_0(4, 21, 32);
- return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000000L, active1, 0L);
- case 116:
- if ((active0 & 0x400000L) != 0L)
- return jjStartNfaWithStates_0(4, 22, 32);
- else if ((active0 & 0x200000000L) != 0L)
- return jjStartNfaWithStates_0(4, 33, 32);
- else if ((active0 & 0x8000000000000L) != 0L)
- return jjStartNfaWithStates_0(4, 51, 32);
- return jjMoveStringLiteralDfa5_0(active0, 0L, active1, 0x1L);
- case 117:
- return jjMoveStringLiteralDfa5_0(active0, 0x1000000L, active1, 0L);
- case 118:
- return jjMoveStringLiteralDfa5_0(active0, 0x80000000000L, active1, 0L);
- case 119:
- if ((active0 & 0x400000000000000L) != 0L)
- {
- jjmatchedKind = 58;
- jjmatchedPos = 4;
- }
- return jjMoveStringLiteralDfa5_0(active0, 0x800000000000000L, active1, 0L);
- default :
- break;
- }
- return jjStartNfa_0(3, active0, active1);
-}
-private int jjMoveStringLiteralDfa5_0(long old0, long active0, long old1, long active1)
-{
- if (((active0 &= old0) | (active1 &= old1)) == 0L)
- return jjStartNfa_0(3, old0, old1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(4, active0, active1);
- return 5;
- }
- switch(curChar)
- {
- case 97:
- return jjMoveStringLiteralDfa6_0(active0, 0xa000L, active1, 0L);
- case 99:
- if ((active0 & 0x2000000000000L) != 0L)
- return jjStartNfaWithStates_0(5, 49, 32);
- else if ((active0 & 0x10000000000000L) != 0L)
- return jjStartNfaWithStates_0(5, 52, 32);
- return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000L, active1, 0L);
- case 100:
- return jjMoveStringLiteralDfa6_0(active0, 0x20000000L, active1, 0L);
- case 101:
- if ((active0 & 0x4000000L) != 0L)
- return jjStartNfaWithStates_0(5, 26, 32);
- else if ((active0 & 0x80000000000L) != 0L)
- return jjStartNfaWithStates_0(5, 43, 32);
- break;
- case 102:
- return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L, active1, 0L);
- case 103:
- return jjMoveStringLiteralDfa6_0(active0, 0x400000000000L, active1, 0L);
- case 104:
- if ((active0 & 0x80000000000000L) != 0L)
- return jjStartNfaWithStates_0(5, 55, 32);
- break;
- case 105:
- return jjMoveStringLiteralDfa6_0(active0, 0x1000000000000000L, active1, 0x1L);
- case 108:
- return jjMoveStringLiteralDfa6_0(active0, 0x101000000L, active1, 0L);
- case 109:
- return jjMoveStringLiteralDfa6_0(active0, 0x2000000000L, active1, 0L);
- case 110:
- if ((active0 & 0x4000000000000L) != 0L)
- return jjStartNfaWithStates_0(5, 50, 32);
- return jjMoveStringLiteralDfa6_0(active0, 0x8000800000L, active1, 0L);
- case 114:
- return jjMoveStringLiteralDfa6_0(active0, 0x100000000000000L, active1, 0L);
- case 115:
- if ((active0 & 0x800000000000000L) != 0L)
- return jjStartNfaWithStates_0(5, 59, 32);
- break;
- case 116:
- if ((active0 & 0x4000L) != 0L)
- return jjStartNfaWithStates_0(5, 14, 32);
- else if ((active0 & 0x4000000000L) != 0L)
- return jjStartNfaWithStates_0(5, 38, 32);
- return jjMoveStringLiteralDfa6_0(active0, 0x20800000000000L, active1, 0L);
- default :
- break;
- }
- return jjStartNfa_0(4, active0, active1);
-}
-private int jjMoveStringLiteralDfa6_0(long old0, long active0, long old1, long active1)
-{
- if (((active0 &= old0) | (active1 &= old1)) == 0L)
- return jjStartNfa_0(4, old0, old1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(5, active0, active1);
- return 6;
- }
- switch(curChar)
- {
- case 97:
- return jjMoveStringLiteralDfa7_0(active0, 0x20000000000L, active1, 0L);
- case 99:
- return jjMoveStringLiteralDfa7_0(active0, 0x8000002000L, active1, 0L);
- case 101:
- if ((active0 & 0x400000000000L) != 0L)
- return jjStartNfaWithStates_0(6, 46, 32);
- else if ((active0 & 0x800000000000L) != 0L)
- return jjStartNfaWithStates_0(6, 47, 32);
- return jjMoveStringLiteralDfa7_0(active0, 0x1000002000000000L, active1, 0L);
- case 102:
- return jjMoveStringLiteralDfa7_0(active0, 0x20000000000000L, active1, 0L);
- case 108:
- return jjMoveStringLiteralDfa7_0(active0, 0L, active1, 0x1L);
- case 110:
- if ((active0 & 0x8000L) != 0L)
- return jjStartNfaWithStates_0(6, 15, 32);
- break;
- case 111:
- return jjMoveStringLiteralDfa7_0(active0, 0x100000000000000L, active1, 0L);
- case 115:
- if ((active0 & 0x20000000L) != 0L)
- return jjStartNfaWithStates_0(6, 29, 32);
- break;
- case 116:
- if ((active0 & 0x1000000L) != 0L)
- return jjStartNfaWithStates_0(6, 24, 32);
- return jjMoveStringLiteralDfa7_0(active0, 0x1000000000000L, active1, 0L);
- case 117:
- return jjMoveStringLiteralDfa7_0(active0, 0x800000L, active1, 0L);
- case 121:
- if ((active0 & 0x100000000L) != 0L)
- return jjStartNfaWithStates_0(6, 32, 32);
- break;
- default :
- break;
- }
- return jjStartNfa_0(5, active0, active1);
-}
-private int jjMoveStringLiteralDfa7_0(long old0, long active0, long old1, long active1)
-{
- if (((active0 &= old0) | (active1 &= old1)) == 0L)
- return jjStartNfa_0(5, old0, old1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(6, active0, active1);
- return 7;
- }
- switch(curChar)
- {
- case 99:
- return jjMoveStringLiteralDfa8_0(active0, 0x20000000000L, active1, 0L);
- case 101:
- if ((active0 & 0x800000L) != 0L)
- return jjStartNfaWithStates_0(7, 23, 32);
- else if ((active1 & 0x1L) != 0L)
- return jjStartNfaWithStates_0(7, 64, 32);
- return jjMoveStringLiteralDfa8_0(active0, 0x1008000000000L, active1, 0L);
- case 110:
- return jjMoveStringLiteralDfa8_0(active0, 0x1100002000000000L, active1, 0L);
- case 112:
- if ((active0 & 0x20000000000000L) != 0L)
- return jjStartNfaWithStates_0(7, 53, 32);
- break;
- case 116:
- if ((active0 & 0x2000L) != 0L)
- return jjStartNfaWithStates_0(7, 13, 32);
- break;
- default :
- break;
- }
- return jjStartNfa_0(6, active0, active1);
-}
-private int jjMoveStringLiteralDfa8_0(long old0, long active0, long old1, long active1)
-{
- if (((active0 &= old0) | (active1 &= old1)) == 0L)
- return jjStartNfa_0(6, old0, old1);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(7, active0, 0L);
- return 8;
- }
- switch(curChar)
- {
- case 100:
- if ((active0 & 0x1000000000000L) != 0L)
- return jjStartNfaWithStates_0(8, 48, 32);
- break;
- case 101:
- if ((active0 & 0x20000000000L) != 0L)
- return jjStartNfaWithStates_0(8, 41, 32);
- break;
- case 105:
- return jjMoveStringLiteralDfa9_0(active0, 0x100000000000000L);
- case 111:
- return jjMoveStringLiteralDfa9_0(active0, 0x8000000000L);
- case 116:
- if ((active0 & 0x1000000000000000L) != 0L)
- return jjStartNfaWithStates_0(8, 60, 32);
- return jjMoveStringLiteralDfa9_0(active0, 0x2000000000L);
- default :
- break;
- }
- return jjStartNfa_0(7, active0, 0L);
-}
-private int jjMoveStringLiteralDfa9_0(long old0, long active0)
-{
- if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(7, old0, 0L);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(8, active0, 0L);
- return 9;
- }
- switch(curChar)
- {
- case 102:
- if ((active0 & 0x8000000000L) != 0L)
- return jjStartNfaWithStates_0(9, 39, 32);
- break;
- case 115:
- if ((active0 & 0x2000000000L) != 0L)
- return jjStartNfaWithStates_0(9, 37, 32);
- break;
- case 122:
- return jjMoveStringLiteralDfa10_0(active0, 0x100000000000000L);
- default :
- break;
- }
- return jjStartNfa_0(8, active0, 0L);
-}
-private int jjMoveStringLiteralDfa10_0(long old0, long active0)
-{
- if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(8, old0, 0L);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(9, active0, 0L);
- return 10;
- }
- switch(curChar)
- {
- case 101:
- return jjMoveStringLiteralDfa11_0(active0, 0x100000000000000L);
- default :
- break;
- }
- return jjStartNfa_0(9, active0, 0L);
-}
-private int jjMoveStringLiteralDfa11_0(long old0, long active0)
-{
- if (((active0 &= old0)) == 0L)
- return jjStartNfa_0(9, old0, 0L);
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- jjStopStringLiteralDfa_0(10, active0, 0L);
- return 11;
- }
- switch(curChar)
- {
- case 100:
- if ((active0 & 0x100000000000000L) != 0L)
- return jjStartNfaWithStates_0(11, 56, 32);
- break;
- default :
- break;
- }
- return jjStartNfa_0(10, active0, 0L);
-}
-private int jjStartNfaWithStates_0(int pos, int kind, int state)
-{
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { return pos + 1; }
- return jjMoveNfa_0(state, pos + 1);
-}
-static final long[] jjbitVec0 = {
- 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
-};
-static final long[] jjbitVec2 = {
- 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL
-};
-static final long[] jjbitVec3 = {
- 0x1ff00000fffffffeL, 0xffffffffffffc000L, 0xffffffffL, 0x600000000000000L
-};
-static final long[] jjbitVec4 = {
- 0x0L, 0x0L, 0x0L, 0xff7fffffff7fffffL
-};
-static final long[] jjbitVec5 = {
- 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
-};
-static final long[] jjbitVec6 = {
- 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffL, 0x0L
-};
-static final long[] jjbitVec7 = {
- 0xffffffffffffffffL, 0xffffffffffffffffL, 0x0L, 0x0L
-};
-static final long[] jjbitVec8 = {
- 0x3fffffffffffL, 0x0L, 0x0L, 0x0L
-};
-private int jjMoveNfa_0(int startState, int curPos)
-{
- int startsAt = 0;
- jjnewStateCnt = 52;
- int i = 1;
- jjstateSet[0] = startState;
- int kind = 0x7fffffff;
- for (;;)
- {
- if (++jjround == 0x7fffffff)
- ReInitRounds();
- if (curChar < 64)
- {
- long l = 1L << curChar;
- do
- {
- switch(jjstateSet[--i])
- {
- case 3:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(0, 6);
- else if (curChar == 36)
- {
- if (kind > 74)
- kind = 74;
- jjCheckNAdd(32);
- }
- else if (curChar == 34)
- jjCheckNAddStates(7, 9);
- else if (curChar == 39)
- jjAddStates(10, 11);
- else if (curChar == 46)
- jjCheckNAdd(8);
- else if (curChar == 47)
- jjstateSet[jjnewStateCnt++] = 2;
- if ((0x3fe000000000000L & l) != 0L)
- {
- if (kind > 66)
- kind = 66;
- jjCheckNAddTwoStates(5, 6);
- }
- else if (curChar == 48)
- {
- if (kind > 66)
- kind = 66;
- jjCheckNAddStates(12, 14);
- }
- break;
- case 0:
- if (curChar == 42)
- jjstateSet[jjnewStateCnt++] = 1;
- break;
- case 1:
- if ((0xffff7fffffffffffL & l) != 0L && kind > 7)
- kind = 7;
- break;
- case 2:
- if (curChar == 42)
- jjstateSet[jjnewStateCnt++] = 0;
- break;
- case 4:
- if ((0x3fe000000000000L & l) == 0L)
- break;
- if (kind > 66)
- kind = 66;
- jjCheckNAddTwoStates(5, 6);
- break;
- case 5:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 66)
- kind = 66;
- jjCheckNAddTwoStates(5, 6);
- break;
- case 7:
- if (curChar == 46)
- jjCheckNAdd(8);
- break;
- case 8:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 70)
- kind = 70;
- jjCheckNAddStates(15, 17);
- break;
- case 10:
- if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(11);
- break;
- case 11:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 70)
- kind = 70;
- jjCheckNAddTwoStates(11, 12);
- break;
- case 13:
- if (curChar == 39)
- jjAddStates(10, 11);
- break;
- case 14:
- if ((0xffffff7fffffdbffL & l) != 0L)
- jjCheckNAdd(15);
- break;
- case 15:
- if (curChar == 39 && kind > 72)
- kind = 72;
- break;
- case 17:
- if ((0x8400000000L & l) != 0L)
- jjCheckNAdd(15);
- break;
- case 18:
- if ((0xff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(19, 15);
- break;
- case 19:
- if ((0xff000000000000L & l) != 0L)
- jjCheckNAdd(15);
- break;
- case 20:
- if ((0xf000000000000L & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 21;
- break;
- case 21:
- if ((0xff000000000000L & l) != 0L)
- jjCheckNAdd(19);
- break;
- case 22:
- if (curChar == 34)
- jjCheckNAddStates(7, 9);
- break;
- case 23:
- if ((0xfffffffbffffdbffL & l) != 0L)
- jjCheckNAddStates(7, 9);
- break;
- case 25:
- if ((0x8400000000L & l) != 0L)
- jjCheckNAddStates(7, 9);
- break;
- case 26:
- if (curChar == 34 && kind > 73)
- kind = 73;
- break;
- case 27:
- if ((0xff000000000000L & l) != 0L)
- jjCheckNAddStates(18, 21);
- break;
- case 28:
- if ((0xff000000000000L & l) != 0L)
- jjCheckNAddStates(7, 9);
- break;
- case 29:
- if ((0xf000000000000L & l) != 0L)
- jjstateSet[jjnewStateCnt++] = 30;
- break;
- case 30:
- if ((0xff000000000000L & l) != 0L)
- jjCheckNAdd(28);
- break;
- case 31:
- if (curChar != 36)
- break;
- if (kind > 74)
- kind = 74;
- jjCheckNAdd(32);
- break;
- case 32:
- if ((0x3ff001000000000L & l) == 0L)
- break;
- if (kind > 74)
- kind = 74;
- jjCheckNAdd(32);
- break;
- case 33:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(0, 6);
- break;
- case 34:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(34, 35);
- break;
- case 35:
- if (curChar != 46)
- break;
- if (kind > 70)
- kind = 70;
- jjCheckNAddStates(22, 24);
- break;
- case 36:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 70)
- kind = 70;
- jjCheckNAddStates(22, 24);
- break;
- case 38:
- if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(39);
- break;
- case 39:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 70)
- kind = 70;
- jjCheckNAddTwoStates(39, 12);
- break;
- case 40:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(40, 41);
- break;
- case 42:
- if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(43);
- break;
- case 43:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 70)
- kind = 70;
- jjCheckNAddTwoStates(43, 12);
- break;
- case 44:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddStates(25, 27);
- break;
- case 46:
- if ((0x280000000000L & l) != 0L)
- jjCheckNAdd(47);
- break;
- case 47:
- if ((0x3ff000000000000L & l) != 0L)
- jjCheckNAddTwoStates(47, 12);
- break;
- case 48:
- if (curChar != 48)
- break;
- if (kind > 66)
- kind = 66;
- jjCheckNAddStates(12, 14);
- break;
- case 50:
- if ((0x3ff000000000000L & l) == 0L)
- break;
- if (kind > 66)
- kind = 66;
- jjCheckNAddTwoStates(50, 6);
- break;
- case 51:
- if ((0xff000000000000L & l) == 0L)
- break;
- if (kind > 66)
- kind = 66;
- jjCheckNAddTwoStates(51, 6);
- break;
- default : break;
- }
- } while(i != startsAt);
- }
- else if (curChar < 128)
- {
- long l = 1L << (curChar & 077);
- do
- {
- switch(jjstateSet[--i])
- {
- case 3:
- case 32:
- if ((0x7fffffe87fffffeL & l) == 0L)
- break;
- if (kind > 74)
- kind = 74;
- jjCheckNAdd(32);
- break;
- case 1:
- if (kind > 7)
- kind = 7;
- break;
- case 6:
- if ((0x100000001000L & l) != 0L && kind > 66)
- kind = 66;
- break;
- case 9:
- if ((0x2000000020L & l) != 0L)
- jjAddStates(28, 29);
- break;
- case 12:
- if ((0x5000000050L & l) != 0L && kind > 70)
- kind = 70;
- break;
- case 14:
- if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAdd(15);
- break;
- case 16:
- if (curChar == 92)
- jjAddStates(30, 32);
- break;
- case 17:
- if ((0x14404410000000L & l) != 0L)
- jjCheckNAdd(15);
- break;
- case 23:
- if ((0xffffffffefffffffL & l) != 0L)
- jjCheckNAddStates(7, 9);
- break;
- case 24:
- if (curChar == 92)
- jjAddStates(33, 35);
- break;
- case 25:
- if ((0x14404410000000L & l) != 0L)
- jjCheckNAddStates(7, 9);
- break;
- case 37:
- if ((0x2000000020L & l) != 0L)
- jjAddStates(36, 37);
- break;
- case 41:
- if ((0x2000000020L & l) != 0L)
- jjAddStates(38, 39);
- break;
- case 45:
- if ((0x2000000020L & l) != 0L)
- jjAddStates(40, 41);
- break;
- case 49:
- if ((0x100000001000000L & l) != 0L)
- jjCheckNAdd(50);
- break;
- case 50:
- if ((0x7e0000007eL & l) == 0L)
- break;
- if (kind > 66)
- kind = 66;
- jjCheckNAddTwoStates(50, 6);
- break;
- default : break;
- }
- } while(i != startsAt);
- }
- else
- {
- int hiByte = (int)(curChar >> 8);
- int i1 = hiByte >> 6;
- long l1 = 1L << (hiByte & 077);
- int i2 = (curChar & 0xff) >> 6;
- long l2 = 1L << (curChar & 077);
- do
- {
- switch(jjstateSet[--i])
- {
- case 3:
- case 32:
- if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
- break;
- if (kind > 74)
- kind = 74;
- jjCheckNAdd(32);
- break;
- case 1:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 7)
- kind = 7;
- break;
- case 14:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjstateSet[jjnewStateCnt++] = 15;
- break;
- case 23:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2))
- jjAddStates(7, 9);
- break;
- default : break;
- }
- } while(i != startsAt);
- }
- if (kind != 0x7fffffff)
- {
- jjmatchedKind = kind;
- jjmatchedPos = curPos;
- kind = 0x7fffffff;
- }
- ++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 52 - (jjnewStateCnt = startsAt)))
- return curPos;
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { return curPos; }
- }
-}
-private int jjMoveStringLiteralDfa0_3()
-{
- switch(curChar)
- {
- case 42:
- return jjMoveStringLiteralDfa1_3(0x800L);
- default :
- return 1;
- }
-}
-private int jjMoveStringLiteralDfa1_3(long active0)
-{
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- return 1;
- }
- switch(curChar)
- {
- case 47:
- if ((active0 & 0x800L) != 0L)
- return jjStopAtPos(1, 11);
- break;
- default :
- return 2;
- }
- return 2;
-}
-private int jjMoveStringLiteralDfa0_1()
-{
- return jjMoveNfa_1(0, 0);
-}
-private int jjMoveNfa_1(int startState, int curPos)
-{
- int startsAt = 0;
- jjnewStateCnt = 3;
- int i = 1;
- jjstateSet[0] = startState;
- int kind = 0x7fffffff;
- for (;;)
- {
- if (++jjround == 0x7fffffff)
- ReInitRounds();
- if (curChar < 64)
- {
- long l = 1L << curChar;
- do
- {
- switch(jjstateSet[--i])
- {
- case 0:
- if ((0x2400L & l) != 0L)
- {
- if (kind > 9)
- kind = 9;
- }
- if (curChar == 13)
- jjstateSet[jjnewStateCnt++] = 1;
- break;
- case 1:
- if (curChar == 10 && kind > 9)
- kind = 9;
- break;
- case 2:
- if (curChar == 13)
- jjstateSet[jjnewStateCnt++] = 1;
- break;
- default : break;
- }
- } while(i != startsAt);
- }
- else if (curChar < 128)
- {
- long l = 1L << (curChar & 077);
- do
- {
- switch(jjstateSet[--i])
- {
- default : break;
- }
- } while(i != startsAt);
- }
- else
- {
- int hiByte = (int)(curChar >> 8);
- int i1 = hiByte >> 6;
- long l1 = 1L << (hiByte & 077);
- int i2 = (curChar & 0xff) >> 6;
- long l2 = 1L << (curChar & 077);
- do
- {
- switch(jjstateSet[--i])
- {
- default : break;
- }
- } while(i != startsAt);
- }
- if (kind != 0x7fffffff)
- {
- jjmatchedKind = kind;
- jjmatchedPos = curPos;
- kind = 0x7fffffff;
- }
- ++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 3 - (jjnewStateCnt = startsAt)))
- return curPos;
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { return curPos; }
- }
-}
-private int jjMoveStringLiteralDfa0_2()
-{
- switch(curChar)
- {
- case 42:
- return jjMoveStringLiteralDfa1_2(0x400L);
- default :
- return 1;
- }
-}
-private int jjMoveStringLiteralDfa1_2(long active0)
-{
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) {
- return 1;
- }
- switch(curChar)
- {
- case 47:
- if ((active0 & 0x400L) != 0L)
- return jjStopAtPos(1, 10);
- break;
- default :
- return 2;
- }
- return 2;
-}
-static final int[] jjnextStates = {
- 34, 35, 40, 41, 44, 45, 12, 23, 24, 26, 14, 16, 49, 51, 6, 8,
- 9, 12, 23, 24, 28, 26, 36, 37, 12, 44, 45, 12, 10, 11, 17, 18,
- 20, 25, 27, 29, 38, 39, 42, 43, 46, 47,
-};
-private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2)
-{
- switch(hiByte)
- {
- case 0:
- return ((jjbitVec2[i2] & l2) != 0L);
- default :
- if ((jjbitVec0[i1] & l1) != 0L)
- return true;
- return false;
- }
-}
-private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2)
-{
- switch(hiByte)
- {
- case 0:
- return ((jjbitVec4[i2] & l2) != 0L);
- case 48:
- return ((jjbitVec5[i2] & l2) != 0L);
- case 49:
- return ((jjbitVec6[i2] & l2) != 0L);
- case 51:
- return ((jjbitVec7[i2] & l2) != 0L);
- case 61:
- return ((jjbitVec8[i2] & l2) != 0L);
- default :
- if ((jjbitVec3[i1] & l1) != 0L)
- return true;
- return false;
- }
-}
-
-/** Token literal values. */
-public static final String[] jjstrLiteralImages = {
-"", null, null, null, null, null, null, null, null, null, null, null, null,
-"\141\142\163\164\162\141\143\164", "\141\163\163\145\162\164", "\142\157\157\154\145\141\156",
-"\142\162\145\141\153", "\142\171\164\145", "\143\141\163\145", "\143\141\164\143\150",
-"\143\150\141\162", "\143\154\141\163\163", "\143\157\156\163\164",
-"\143\157\156\164\151\156\165\145", "\144\145\146\141\165\154\164", "\144\157", "\144\157\165\142\154\145",
-"\145\154\163\145", "\145\156\165\155", "\145\170\164\145\156\144\163", "\146\141\154\163\145",
-"\146\151\156\141\154", "\146\151\156\141\154\154\171", "\146\154\157\141\164", "\146\157\162",
-"\147\157\164\157", "\151\146", "\151\155\160\154\145\155\145\156\164\163",
-"\151\155\160\157\162\164", "\151\156\163\164\141\156\143\145\157\146", "\151\156\164",
-"\151\156\164\145\162\146\141\143\145", "\154\157\156\147", "\156\141\164\151\166\145", "\156\145\167",
-"\156\165\154\154", "\160\141\143\153\141\147\145", "\160\162\151\166\141\164\145",
-"\160\162\157\164\145\143\164\145\144", "\160\165\142\154\151\143", "\162\145\164\165\162\156",
-"\163\150\157\162\164", "\163\164\141\164\151\143", "\163\164\162\151\143\164\146\160",
-"\163\165\160\145\162", "\163\167\151\164\143\150",
-"\163\171\156\143\150\162\157\156\151\172\145\144", "\164\150\151\163", "\164\150\162\157\167", "\164\150\162\157\167\163",
-"\164\162\141\156\163\151\145\156\164", "\164\162\165\145", "\164\162\171", "\166\157\151\144",
-"\166\157\154\141\164\151\154\145", "\167\150\151\154\145", null, null, null, null, null, null, null, null, null,
-null, null, "\50", "\51", "\173", "\175", "\133", "\135", "\73", "\54", "\56",
-"\100", "\75", "\74", "\41", "\176", "\77", "\72", "\75\75", "\74\75", "\76\75",
-"\41\75", "\174\174", "\46\46", "\53\53", "\55\55", "\53", "\55", "\52", "\57", "\46",
-"\174", "\136", "\45", "\74\74", "\53\75", "\55\75", "\52\75", "\57\75", "\46\75",
-"\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", "\76\76\76\75", "\56\56\56",
-"\76\76\76", "\76\76", "\76", };
-
-/** Lexer state names. */
-public static final String[] lexStateNames = {
- "DEFAULT",
- "IN_SINGLE_LINE_COMMENT",
- "IN_FORMAL_COMMENT",
- "IN_MULTI_LINE_COMMENT",
-};
-
-/** Lex State array. */
-public static final int[] jjnewLexState = {
- -1, -1, -1, -1, -1, -1, 1, 2, 3, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-};
-static final long[] jjtoToken = {
- 0xffffffffffffe001L, 0x1fffffffffffe747L,
-};
-static final long[] jjtoSkip = {
- 0xe3eL, 0x0L,
-};
-static final long[] jjtoSpecial = {
- 0xe00L, 0x0L,
-};
-static final long[] jjtoMore = {
- 0x11c0L, 0x0L,
-};
-protected JavaCharStream input_stream;
-private final int[] jjrounds = new int[52];
-private final int[] jjstateSet = new int[104];
-private final StringBuilder jjimage = new StringBuilder();
-private StringBuilder image = jjimage;
-private int jjimageLen;
-private int lengthOfMatch;
-protected char curChar;
-/** Constructor. */
-public JavaParserTokenManager(JavaCharStream stream){
- if (JavaCharStream.staticFlag)
- throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
- input_stream = stream;
-}
-
-/** Constructor. */
-public JavaParserTokenManager(JavaCharStream stream, int lexState){
- this(stream);
- SwitchTo(lexState);
-}
-
-/** Reinitialise parser. */
-public void ReInit(JavaCharStream stream)
-{
- jjmatchedPos = jjnewStateCnt = 0;
- curLexState = defaultLexState;
- input_stream = stream;
- ReInitRounds();
-}
-private void ReInitRounds()
-{
- int i;
- jjround = 0x80000001;
- for (i = 52; i-- > 0;)
- jjrounds[i] = 0x80000000;
-}
-
-/** Reinitialise parser. */
-public void ReInit(JavaCharStream stream, int lexState)
-{
- ReInit(stream);
- SwitchTo(lexState);
-}
-
-/** Switch to specified lex state. */
-public void SwitchTo(int lexState)
-{
- if (lexState >= 4 || lexState < 0)
- throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
- else
- curLexState = lexState;
-}
-
-protected Token jjFillToken()
-{
- final Token t;
- final String curTokenImage;
- final int beginLine;
- final int endLine;
- final int beginColumn;
- final int endColumn;
- String im = jjstrLiteralImages[jjmatchedKind];
- curTokenImage = (im == null) ? input_stream.GetImage() : im;
- beginLine = input_stream.getBeginLine();
- beginColumn = input_stream.getBeginColumn();
- endLine = input_stream.getEndLine();
- endColumn = input_stream.getEndColumn();
- t = Token.newToken(jjmatchedKind);
- t.kind = jjmatchedKind;
- t.image = curTokenImage;
-
- t.beginLine = beginLine;
- t.endLine = endLine;
- t.beginColumn = beginColumn;
- t.endColumn = endColumn;
-
- return t;
-}
-
-int curLexState = 0;
-int defaultLexState = 0;
-int jjnewStateCnt;
-int jjround;
-int jjmatchedPos;
-int jjmatchedKind;
-
-/** Get the next Token. */
-public Token getNextToken()
-{
- Token specialToken = null;
- Token matchedToken;
- int curPos = 0;
-
- EOFLoop :
- for (;;)
- {
- try
- {
- curChar = input_stream.BeginToken();
- }
- catch(java.io.IOException e)
- {
- jjmatchedKind = 0;
- matchedToken = jjFillToken();
- matchedToken.specialToken = specialToken;
- return matchedToken;
- }
- image = jjimage;
- image.setLength(0);
- jjimageLen = 0;
-
- for (;;)
- {
- switch(curLexState)
- {
- case 0:
- try { input_stream.backup(0);
- while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L)
- curChar = input_stream.BeginToken();
- }
- catch (java.io.IOException e1) { continue EOFLoop; }
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_0();
- break;
- case 1:
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_1();
- if (jjmatchedPos == 0 && jjmatchedKind > 12)
- {
- jjmatchedKind = 12;
- }
- break;
- case 2:
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_2();
- if (jjmatchedPos == 0 && jjmatchedKind > 12)
- {
- jjmatchedKind = 12;
- }
- break;
- case 3:
- jjmatchedKind = 0x7fffffff;
- jjmatchedPos = 0;
- curPos = jjMoveStringLiteralDfa0_3();
- if (jjmatchedPos == 0 && jjmatchedKind > 12)
- {
- jjmatchedKind = 12;
- }
- break;
- }
- if (jjmatchedKind != 0x7fffffff)
- {
- if (jjmatchedPos + 1 < curPos)
- input_stream.backup(curPos - jjmatchedPos - 1);
- if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
- {
- matchedToken = jjFillToken();
- matchedToken.specialToken = specialToken;
- TokenLexicalActions(matchedToken);
- if (jjnewLexState[jjmatchedKind] != -1)
- curLexState = jjnewLexState[jjmatchedKind];
- return matchedToken;
- }
- else if ((jjtoSkip[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
- {
- if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
- {
- matchedToken = jjFillToken();
- if (specialToken == null)
- specialToken = matchedToken;
- else
- {
- matchedToken.specialToken = specialToken;
- specialToken = (specialToken.next = matchedToken);
- }
- SkipLexicalActions(matchedToken);
- }
- else
- SkipLexicalActions(null);
- if (jjnewLexState[jjmatchedKind] != -1)
- curLexState = jjnewLexState[jjmatchedKind];
- continue EOFLoop;
- }
- MoreLexicalActions();
- if (jjnewLexState[jjmatchedKind] != -1)
- curLexState = jjnewLexState[jjmatchedKind];
- curPos = 0;
- jjmatchedKind = 0x7fffffff;
- try {
- curChar = input_stream.readChar();
- continue;
- }
- catch (java.io.IOException e1) { }
- }
- int error_line = input_stream.getEndLine();
- int error_column = input_stream.getEndColumn();
- String error_after = null;
- boolean EOFSeen = false;
- try { input_stream.readChar(); input_stream.backup(1); }
- catch (java.io.IOException e1) {
- EOFSeen = true;
- error_after = curPos <= 1 ? "" : input_stream.GetImage();
- if (curChar == '\n' || curChar == '\r') {
- error_line++;
- error_column = 0;
- }
- else
- error_column++;
- }
- if (!EOFSeen) {
- input_stream.backup(1);
- error_after = curPos <= 1 ? "" : input_stream.GetImage();
- }
- throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR);
- }
- }
-}
-
-void SkipLexicalActions(Token matchedToken)
-{
- switch(jjmatchedKind)
- {
- default :
- break;
- }
-}
-void MoreLexicalActions()
-{
- jjimageLen += (lengthOfMatch = jjmatchedPos + 1);
- switch(jjmatchedKind)
- {
- case 7 :
- image.append(input_stream.GetSuffix(jjimageLen));
- jjimageLen = 0;
- input_stream.backup(1);
- break;
- default :
- break;
- }
-}
-void TokenLexicalActions(Token matchedToken)
-{
- switch(jjmatchedKind)
- {
- case 122 :
- image.append(jjstrLiteralImages[122]);
- lengthOfMatch = jjstrLiteralImages[122].length();
- matchedToken.kind = GT;
- ((Token.GTToken)matchedToken).realKind = RUNSIGNEDSHIFT;
- input_stream.backup(2);
- break;
- case 123 :
- image.append(jjstrLiteralImages[123]);
- lengthOfMatch = jjstrLiteralImages[123].length();
- matchedToken.kind = GT;
- ((Token.GTToken)matchedToken).realKind = RSIGNEDSHIFT;
- input_stream.backup(1);
- break;
- default :
- break;
- }
-}
-private void jjCheckNAdd(int state)
-{
- if (jjrounds[state] != jjround)
- {
- jjstateSet[jjnewStateCnt++] = state;
- jjrounds[state] = jjround;
- }
-}
-private void jjAddStates(int start, int end)
-{
- do {
- jjstateSet[jjnewStateCnt++] = jjnextStates[start];
- } while (start++ != end);
-}
-private void jjCheckNAddTwoStates(int state1, int state2)
-{
- jjCheckNAdd(state1);
- jjCheckNAdd(state2);
-}
-
-private void jjCheckNAddStates(int start, int end)
-{
- do {
- jjCheckNAdd(jjnextStates[start]);
- } while (start++ != end);
-}
-
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/MyToken.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/MyToken.class
deleted file mode 100644
index 1da9ff2..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/MyToken.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/MyToken.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/MyToken.java
deleted file mode 100644
index 6a3e3aa..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/MyToken.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package harsh.javatoxml.grammar;
-
-public class MyToken extends Token
-{
- /**
- * Constructs a new token for the specified Image and Kind.
- */
- public MyToken(int kind, String image)
- {
- this.kind = kind;
- this.image = image;
- }
-
- int realKind = JavaParserConstants.GT;
-
- /**
- * Returns a new Token object.
- */
-
- public static final Token newToken(int ofKind, String tokenImage)
- {
- return new MyToken(ofKind, tokenImage);
- }
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/ParseException.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/ParseException.class
deleted file mode 100644
index 711358c..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/ParseException.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/ParseException.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/ParseException.java
deleted file mode 100644
index 7a959d6..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/ParseException.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
-/* JavaCCOptions:KEEP_LINE_COL=null */
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-
-/**
- * This exception is thrown when parse errors are encountered.
- * You can explicitly create objects of this exception type by
- * calling the method generateParseException in the generated
- * parser.
- *
- * You can modify this class to customize your error reporting
- * mechanisms so long as you retain the public fields.
- */
-public class ParseException extends Exception {
-
- /**
- * The version identifier for this Serializable class.
- * Increment only if the <i>serialized</i> form of the
- * class changes.
- */
- private static final long serialVersionUID = 1L;
-
- /**
- * This constructor is used by the method "generateParseException"
- * in the generated parser. Calling this constructor generates
- * a new object of this type with the fields "currentToken",
- * "expectedTokenSequences", and "tokenImage" set.
- */
- public ParseException(Token currentTokenVal,
- int[][] expectedTokenSequencesVal,
- String[] tokenImageVal
- )
- {
- super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
- currentToken = currentTokenVal;
- expectedTokenSequences = expectedTokenSequencesVal;
- tokenImage = tokenImageVal;
- }
-
- /**
- * The following constructors are for use by you for whatever
- * purpose you can think of. Constructing the exception in this
- * manner makes the exception behave in the normal way - i.e., as
- * documented in the class "Throwable". The fields "errorToken",
- * "expectedTokenSequences", and "tokenImage" do not contain
- * relevant information. The JavaCC generated code does not use
- * these constructors.
- */
-
- public ParseException() {
- super();
- }
-
- /** Constructor with message. */
- public ParseException(String message) {
- super(message);
- }
-
-
- /**
- * This is the last token that has been consumed successfully. If
- * this object has been created due to a parse error, the token
- * followng this token will (therefore) be the first error token.
- */
- public Token currentToken;
-
- /**
- * Each entry in this array is an array of integers. Each array
- * of integers represents a sequence of tokens (by their ordinal
- * values) that is expected at this point of the parse.
- */
- public int[][] expectedTokenSequences;
-
- /**
- * This is a reference to the "tokenImage" array of the generated
- * parser within which the parse error occurred. This array is
- * defined in the generated ...Constants interface.
- */
- public String[] tokenImage;
-
- /**
- * It uses "currentToken" and "expectedTokenSequences" to generate a parse
- * error message and returns it. If this object has been created
- * due to a parse error, and you do not catch it (it gets thrown
- * from the parser) the correct error message
- * gets displayed.
- */
- private static String initialise(Token currentToken,
- int[][] expectedTokenSequences,
- String[] tokenImage) {
- String eol = System.getProperty("line.separator", "\n");
- StringBuffer expected = new StringBuffer();
- int maxSize = 0;
- for (int i = 0; i < expectedTokenSequences.length; i++) {
- if (maxSize < expectedTokenSequences[i].length) {
- maxSize = expectedTokenSequences[i].length;
- }
- for (int j = 0; j < expectedTokenSequences[i].length; j++) {
- expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');
- }
- if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
- expected.append("...");
- }
- expected.append(eol).append(" ");
- }
- String retval = "Encountered \"";
- Token tok = currentToken.next;
- for (int i = 0; i < maxSize; i++) {
- if (i != 0) retval += " ";
- if (tok.kind == 0) {
- retval += tokenImage[0];
- break;
- }
- retval += " " + tokenImage[tok.kind];
- retval += " \"";
- retval += add_escapes(tok.image);
- retval += " \"";
- tok = tok.next;
- }
- retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
- retval += "." + eol;
- if (expectedTokenSequences.length == 1) {
- retval += "Was expecting:" + eol + " ";
- } else {
- retval += "Was expecting one of:" + eol + " ";
- }
- retval += expected.toString();
- return retval;
- }
-
- /**
- * The end of line string for this machine.
- */
- protected String eol = System.getProperty("line.separator", "\n");
-
- /**
- * Used to convert raw characters to their escaped version
- * when these raw version cannot be used as part of an ASCII
- * string literal.
- */
- static String add_escapes(String str) {
- StringBuffer retval = new StringBuffer();
- char ch;
- for (int i = 0; i < str.length(); i++) {
- switch (str.charAt(i))
- {
- case 0 :
- continue;
- case '\b':
- retval.append("\\b");
- continue;
- case '\t':
- retval.append("\\t");
- continue;
- case '\n':
- retval.append("\\n");
- continue;
- case '\f':
- retval.append("\\f");
- continue;
- case '\r':
- retval.append("\\r");
- continue;
- case '\"':
- retval.append("\\\"");
- continue;
- case '\'':
- retval.append("\\\'");
- continue;
- case '\\':
- retval.append("\\\\");
- continue;
- default:
- if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
- String s = "0000" + Integer.toString(ch, 16);
- retval.append("\\u" + s.substring(s.length() - 4, s.length()));
- } else {
- retval.append(ch);
- }
- continue;
- }
- }
- return retval.toString();
- }
-
-}
-/* JavaCC - OriginalChecksum=d0b19e9bd8cfc8a7942021e94bea83c4 (do not edit this line) */
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token$GTToken.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token$GTToken.class
deleted file mode 100644
index 7390612..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token$GTToken.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token.class
deleted file mode 100644
index 7fa823a..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token.java
deleted file mode 100644
index 46a6889..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/Token.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */
-package harsh.javatoxml.grammar;
-
-/**
- * Describes the input token stream.
- */
-
-public class Token {
-
- /**
- * An integer that describes the kind of this token. This numbering
- * system is determined by JavaCCParser, and a table of these numbers is
- * stored in the file ...Constants.java.
- */
- public int kind;
-
- /**
- * beginLine and beginColumn describe the position of the first character
- * of this token; endLine and endColumn describe the position of the
- * last character of this token.
- */
- public int beginLine, beginColumn, endLine, endColumn;
-
- /**
- * The string image of the token.
- */
- public String image;
-
- /**
- * A reference to the next regular (non-special) token from the input
- * stream. If this is the last token from the input stream, or if the
- * token manager has not read tokens beyond this one, this field is
- * set to null. This is true only if this token is also a regular
- * token. Otherwise, see below for a description of the contents of
- * this field.
- */
- public Token next;
-
- /**
- * This field is used to access special tokens that occur prior to this
- * token, but after the immediately preceding regular (non-special) token.
- * If there are no such special tokens, this field is set to null.
- * When there are more than one such special token, this field refers
- * to the last of these special tokens, which in turn refers to the next
- * previous special token through its specialToken field, and so on
- * until the first special token (whose specialToken field is null).
- * The next fields of special tokens refer to other special tokens that
- * immediately follow it (without an intervening regular token). If there
- * is no such token, this field is null.
- */
- public Token specialToken;
-
- /**
- * Returns the image.
- */
- public String toString()
- {
- return image;
- }
-
- /**
- * Returns a new Token object, by default. However, if you want, you
- * can create and return subclass objects based on the value of ofKind.
- * Simply add the cases to the switch for all those special cases.
- * For example, if you have a subclass of Token called IDToken that
- * you want to create if ofKind is ID, simlpy add something like :
- *
- * case MyParserConstants.ID : return new IDToken();
- *
- * to the following switch statement. Then you can cast matchedToken
- * variable to the appropriate type and use it in your lexical actions.
- */
- public static final Token newToken(int ofKind)
- {
- switch(ofKind)
- {
- default : return new Token();
- case JavaParserConstants.RUNSIGNEDSHIFT:
- case JavaParserConstants.RSIGNEDSHIFT:
- case JavaParserConstants.GT:
- return new GTToken();
- }
- }
-
- public static class GTToken extends Token
- {
- int realKind = JavaParserConstants.GT;
- }
-}
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/TokenMgrError.class b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/TokenMgrError.class
deleted file mode 100644
index a7bfa48..0000000
Binary files a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/TokenMgrError.class and /dev/null differ
diff --git a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/TokenMgrError.java b/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/TokenMgrError.java
deleted file mode 100644
index 4acf9f5..0000000
--- a/java2lisaac/Java2Lisaac.ml/harsh/javatoxml/grammar/TokenMgrError.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
-/* JavaCCOptions: */
-/*
- *
- * This file is part of java2XML
- * Copyright (C) Harsh Jain, All Rights Reserved.
- * Email : harsh at harshjain.com Website : http://www.harshjain.com/
- *
- * This software is provided 'as-is', without any express or implied warranty.
- * In no event will the authors be held liable for any damages arising from the
- * use of this software.
- *
- * Permission is granted to anyone to use this software for any non-commercial
- * applications freely, subject to the following restriction.
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software in
- * a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- *
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- *
- * 3. This notice must not be removed or altered from any source distribution.
- *
- * For using this software for commercial purpose please contact the author.
- *
- *
- */
-
-package harsh.javatoxml.grammar;
-
-/** Token Manager Error. */
-public class TokenMgrError extends Error
-{
-
- /**
- * The version identifier for this Serializable class.
- * Increment only if the <i>serialized</i> form of the
- * class changes.
- */
- private static final long serialVersionUID = 1L;
-
- /*
- * Ordinals for various reasons why an Error of this type can be thrown.
- */
-
- /**
- * Lexical error occurred.
- */
- static final int LEXICAL_ERROR = 0;
-
- /**
- * An attempt was made to create a second instance of a static token manager.
- */
- static final int STATIC_LEXER_ERROR = 1;
-
- /**
- * Tried to change to an invalid lexical state.
- */
- static final int INVALID_LEXICAL_STATE = 2;
-
- /**
- * Detected (and bailed out of) an infinite loop in the token manager.
- */
- static final int LOOP_DETECTED = 3;
-
- /**
- * Indicates the reason why the exception is thrown. It will have
- * one of the above 4 values.
- */
- int errorCode;
-
- /**
- * Replaces unprintable characters by their escaped (or unicode escaped)
- * equivalents in the given string
- */
- protected static final String addEscapes(String str) {
- StringBuffer retval = new StringBuffer();
- char ch;
- for (int i = 0; i < str.length(); i++) {
- switch (str.charAt(i))
- {
- case 0 :
- continue;
- case '\b':
- retval.append("\\b");
- continue;
- case '\t':
- retval.append("\\t");
- continue;
- case '\n':
- retval.append("\\n");
- continue;
- case '\f':
- retval.append("\\f");
- continue;
- case '\r':
- retval.append("\\r");
- continue;
- case '\"':
- retval.append("\\\"");
- continue;
- case '\'':
- retval.append("\\\'");
- continue;
- case '\\':
- retval.append("\\\\");
- continue;
- default:
- if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
- String s = "0000" + Integer.toString(ch, 16);
- retval.append("\\u" + s.substring(s.length() - 4, s.length()));
- } else {
- retval.append(ch);
- }
- continue;
- }
- }
- return retval.toString();
- }
-
- /**
- * Returns a detailed message for the Error when it is thrown by the
- * token manager to indicate a lexical error.
- * Parameters :
- * EOFSeen : indicates if EOF caused the lexical error
- * curLexState : lexical state in which this error occurred
- * errorLine : line number when the error occurred
- * errorColumn : column number when the error occurred
- * errorAfter : prefix that was seen before this error occurred
- * curchar : the offending character
- * Note: You can customize the lexical error message by modifying this method.
- */
- protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
- return("Lexical error at line " +
- errorLine + ", column " +
- errorColumn + ". Encountered: " +
- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
- "after : \"" + addEscapes(errorAfter) + "\"");
- }
-
- /**
- * You can also modify the body of this method to customize your error messages.
- * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
- * of end-users concern, so you can return something like :
- *
- * "Internal Error : Please file a bug report .... "
- *
- * from this method for such cases in the release version of your parser.
- */
- public String getMessage() {
- return super.getMessage();
- }
-
- /*
- * Constructors of various flavors follow.
- */
-
- /** No arg constructor. */
- public TokenMgrError() {
- }
-
- /** Constructor with message and reason. */
- public TokenMgrError(String message, int reason) {
- super(message);
- errorCode = reason;
- }
-
- /** Full Constructor. */
- public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
- this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
- }
-}
-/* JavaCC - OriginalChecksum=8b00810f800f80bf80f207be3bb9629d (do not edit this line) */
--
applications.git
More information about the Lisaac-commits
mailing list