jxp-1.6.1/ 40755 0 0 0 10530435351 7351 5ustar 0 0 jxp-1.6.1/src/ 40755 0 0 0 10530435353 10142 5ustar 0 0 jxp-1.6.1/src/java/ 40755 0 0 0 10530435351 11061 5ustar 0 0 jxp-1.6.1/src/java/org/ 40755 0 0 0 10530435351 11650 5ustar 0 0 jxp-1.6.1/src/java/org/onemind/ 40755 0 0 0 10530435351 13301 5ustar 0 0 jxp-1.6.1/src/java/org/onemind/jxp/ 40755 0 0 0 10530435356 14107 5ustar 0 0 jxp-1.6.1/src/java/org/onemind/jxp/ant/ 40755 0 0 0 10530435354 14667 5ustar 0 0 jxp-1.6.1/src/java/org/onemind/jxp/config/ 40755 0 0 0 10530435356 15354 5ustar 0 0 jxp-1.6.1/src/java/org/onemind/jxp/parser/ 40755 0 0 0 10530435356 15403 5ustar 0 0 jxp-1.6.1/src/java/org/onemind/jxp/servlet/ 40755 0 0 0 10530435354 15571 5ustar 0 0 jxp-1.6.1/src/java/org/onemind/jxp/util/ 40755 0 0 0 10530435352 15060 5ustar 0 0 jxp-1.6.1/src/scripts/ 40755 0 0 0 10530435355 11633 5ustar 0 0 jxp-1.6.1/src/test/ 40755 0 0 0 10530435353 11121 5ustar 0 0 jxp-1.6.1/src/test/org/ 40755 0 0 0 10530435352 11707 5ustar 0 0 jxp-1.6.1/src/test/org/onemind/ 40755 0 0 0 10530435352 13340 5ustar 0 0 jxp-1.6.1/src/test/org/onemind/jxp/ 40755 0 0 0 10530435356 14145 5ustar 0 0 jxp-1.6.1/src/test/org/onemind/jxp/ant/ 40755 0 0 0 10530435354 14725 5ustar 0 0 jxp-1.6.1/src/test/org/onemind/jxp/included/ 40755 0 0 0 10530435356 15734 5ustar 0 0 jxp-1.6.1/src/test/org/onemind/jxp/util/ 40755 0 0 0 10530435355 15121 5ustar 0 0 jxp-1.6.1/build.xml100644 0 0 14776 10530435351 11326 0ustar 0 0 ================================= WARNING ================================ Junit isn't present in your ${ANT_HOME}/lib directory. Tests not executed. ========================================================================== jxp-1.6.1/maven.xml100644 0 0 4501 10530435350 11275 0ustar 0 0 jxp-1.6.1/project.properties100644 0 0 470 10530435351 13213 0ustar 0 0 #repository maven.repo.central= maven.repo.central.directory= maven.repo.remote=http://www.ibiblio.org/maven,http://onemind-commons.sf.net/maven #maven.repo.remote.enabled=true maven.license.licenseFile=docs/License.txt #site generation maven.docs.src=xdocs maven.xdoc.includeProjectDocumentation=yes jxp-1.6.1/project.xml100644 0 0 6407 10530435351 11645 0ustar 0 0 1 jxp onemind-jxp jxp 1.6.1 2004 org.onemind.jxp /images/logo.gif Java scripted page is a script processor/template engine that can excuted scripts that contains plain text and java code. Java Scripted Page http://jxp.sourceforge.net http://sourceforge.net/tracker/?group_id=114717 jxp.sf.net http://onemind-commons.sourceforge.net maven scm:cvs:pserver:anonymous@cvs.sf.net:/cvsroot/jxp:jxp http://cvs.sf.net/viewcvs.py/jxp ${pom.name} Dev List ${pom.name} User List onemind-commons commons-java 1.5.5 onemind-commons commons-invoke 1.1.0 junit junit 3.8.1 servletapi servletapi 2.3 commons-fileupload commons-fileupload 1.0 ant ant 1.6.2 src src/test **/*Test.java src/test **/*.xml **/*.jxp jxp-1.6.1/src/java/org/onemind/jxp/ant/AntTaskPropertiesSetter.java100644 0 0 5273 10530435352 22445 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.ant; import java.lang.reflect.Method; import java.util.HashSet; import java.util.Map; import java.util.logging.Logger; import org.apache.tools.ant.Task; import org.onemind.commons.java.lang.reflect.ReflectUtils; public class AntTaskPropertiesSetter { private static final Logger _logger = Logger.getLogger(AntTaskPropertiesSetter.class.getName()); private AntTaskPropertiesSetter() { } public static void setTaskProperties(Task t, Map env) { Method[] methods = t.getClass().getMethods(); String propName = null; try { HashSet doneProp = new HashSet(); for (int i = 0; i < methods.length; i++) { String name = methods[i].getName(); if (name.startsWith("set")) { propName = name.substring(3); propName = Character.toLowerCase(propName.charAt(0)) + propName.substring(1); _logger.fine("Checking property " + propName + " of " + t); if (!doneProp.contains(propName)) { Object value = env.get(propName); if (value != null) { _logger.fine("Setting property " + propName + " of " + t + " to " + value); Object[] args = new Object[]{value}; Method m = ReflectUtils.getMethod(t.getClass(), name, args); m.invoke(t, args); doneProp.add(value); } } } } } catch (Exception e) { throw new RuntimeException("Cannot set property \"" + propName + "\": " + e.getMessage(), e); } } }jxp-1.6.1/src/java/org/onemind/jxp/ant/jant-core.jxp100644 0 0 11264 10530435352 17413 0ustar 0 0 <% import static org.onemind.jxp.ant.AntTaskPropertiesSetter; import org.apache.tools.ant.taskdefs.*; import org.apache.tools.ant.types.*; import java.io.*; function void _runAntTask(var t){ setTaskProperties(t, getJxpEnvironment()); t.execute(); } function void ant( String antFile: null, File dir: null, String target: null, String output: null, boolean inheritAll: true, boolean inheritRefs: false, var inheritAll: false, var inheritRefs: false){ _runAntTask(new Ant()); } function void antCall( String target, boolean inheritAll: true, boolean inheritRefs: false){ _runAntTask(new Ant()); } function void antStructure(){ throw UnsupportedOperationException("Not implemented"); } function void apply(String common, File dest: null, boolean spawn: false, File dir: null, boolean relative: false, String forwardSlash: false, String os: null, File output: null, File error: null, var logError: null, boolean append: false, String outputProperty: null, String errorProperty: null, File input: null, String inputString: null, String resultProperty: null, long timeout: Long.MAX_VALUE, boolean failOnError: false, boolean failIfExecutionFails: false, boolean skipEmptyFileSets: false, boolean parallel: false, String type: "file", boolean newEnvironment: false, boolean vmLauncher: true, boolean resolveExecutable: false, int maxParallel: 0, boolean addSourceFile: true, boolean verbose: false, boolean ignoreMissing: true, boolean force: false ){ _runAntTask(new ExecOn()); } function void Available(String property, String value: "true", String className: null, File file: null, String resource: null, Path classpath: null, Path filePath: filePath, Reference classpathRef: null, String type: null, boolean ignoreSystemClasses: false ){ _runAntTask(new Available()); } function void Basename(File file, String property, String suffix: null){ _runAntTask(new Basename()); } function void BuildNumber(File file){ _runAntTask(new BuildNumber()); } function void bunzip2(File src, File dest: null){ _runAntTask(new BUnzip2()); } function void bzip2(File src, File destFile: null, File zipFile: null){ _runAntTask(new BZip2()); } function void checksum(File file, File toDir: null, String algorithm: null, String provider: null, String fileext: null, String property: null, String totalProperty: null, boolean forceOverwrite: false, boolean verifyProperty: false, int readBufferSize: 8192){ _runAntTask(new Checksum()); } function void chmod(File file:null, File dir:null, String perm: null, String includes: null, String excludes: null, String defaultExcludes: null, boolean parallel: true, String type: file, int maxParallel: 0, boolean verbose: false){ _runAntTask(new Chmod()); } function void concat(File destFile: null, boolean append: false, boolean force: true, String encoding: null, String outputEncoding: null, boolean fixLastline: false, String crlf: null){ //TODO: convert crlf to type _runAntTask(new Concat()); } function void copy( File file, File tofile, boolean overwrite: false, boolean preserveLastModified: false, boolean flatten: false, boolean filtering: false, var includeEmptyDir: true, var failonerror:true, var verbose: false, var encoding: null ){ _runAntTask(new Copy()); } function void defaultExcludes( boolean echo: false, boolean Default: false, String add: null, String remove: null){ _runAntTask(new DefaultExcludes()); } function void delete(File file: null, File dir: null, boolean verbose: false, boolean quite: false, boolean failOnError: true, boolean includeEmptyDirs: false, String includes: null, String includesFile: null, String excludes: null, String excludesFile: null, boolean defaultExcludes: true, boolean deleteOnExit: false){ _runAntTask(new Delete()); } function void dirname(File file, String property){ _runAntTask(new Dirname()); } function void ear(File destfile, File appXml: null, File baseDir: null, boolean compress: false, boolean keepCompression: false, String encoding: null, boolean filesOnly: false, String includes: null, String includesFile: null, String excludes: null, String excludesFile: null, boolean defaultExcludes: true, File manifest: null, boolean update: false, String duplicate: false, boolean roundup: true){ _runAntTask(new Ear()); } %>jxp-1.6.1/src/java/org/onemind/jxp/ant/jant-cvs.jxp100644 0 0 3253 10530435354 17237 0ustar 0 0 <% function cvs( String command: "checkout", boolean compression: false, int compressionLevel: 1, String cvsRoot: null, String cvsRsh: null, File dest: null, String package: null, String tag: null, String date: null, boolean quite: false, boolean reallyQuite: false, boolean noExec: false, File output: null, File error: null, boolean append: false, int port: 2401, File passfile: null, boolean failOnError: false){ _runAntTask(new Cvs()); } function cvsChangelog( File destFile, String cvsRoot: null, String cvsRsh: null, String package: null, String tag: null, int port: 2401, File passfile: null, boolean failOnError: false, String dir: null, File usersFile: null, String daysInPast: null, String start: null, String end: null){ _runAntTask(new CvsChangeLog()); } function cvsVersion( String cvsRoot: null, String cvsRsh: null, File dest, String package: null, int port: 2401, File passfile: null, boolean failOnError: false, String clientVersionProperty: null, String serverVersionProperty: null){ _runAntTask(new CvsVersion()); } function cvsPass( String cvsRoot, String password, String passfile: null){ _runAntTask(new CvsPass()); } function cvsTagDiff( File destFile, String startTag: null, String startDate: null, String endTag: null, String endDate: null, boolean compression: false, String cvsRoot: null, String cvsRsh: null, String package: null, boolean quite: false, int port: 2401, File passfile: null, boolean failOnError: false){ _runAntTask(new CvsTagDiff()); } %>jxp-1.6.1/src/java/org/onemind/jxp/ant/JxpAntTask.java100644 0 0 6374 10530435352 17666 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.ant; import java.io.*; import java.util.HashMap; import java.util.Map; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; import org.onemind.jxp.*; public class JxpAntTask extends Task { private StringBuffer _script; private String _scriptPath; private MultiSourcePageSource _rootSource; private ByteArrayPageSource _bufferedPageSource; public JxpAntTask() { //set up the page source setTaskName("jxp"); _rootSource = new MultiSourcePageSource(); _bufferedPageSource = new ByteArrayPageSource(); _rootSource.addPageSource(new ResourceStreamPageSource("/org/onemind/jxp/ant")); _rootSource.addPageSource(_bufferedPageSource); _script = new StringBuffer(); } public void setScriptPath(String scriptPath) { _scriptPath = scriptPath; } public void addText(String text) { _script.append(text); } public void execute() throws BuildException { if (_script == null) { throw new IllegalArgumentException("No script has been written in the task context"); } FilePageSource ps = null; if (_scriptPath != null) { ps = new FilePageSource(_scriptPath); } else { ps = new FilePageSource("."); //current directory } _rootSource.addPageSource(ps); Map env = new HashMap(); env.putAll(project.getProperties()); env.put("project", super.getProject()); env.put("location", super.getLocation()); env.put("description", super.getDescription()); env.put("target", super.getOwningTarget()); env.put("taskname", super.getTaskName()); JxpProcessor processor = new JxpProcessor(new JxpContext(_rootSource, env)); _script.insert(0, "<%"); _script.append("%>"); _bufferedPageSource.putPageBuffer(getTaskName(), _script.toString().getBytes()); Writer w = new PrintWriter(new OutputStreamWriter(System.out)); try { processor.process(getTaskName(), w); w.flush(); } catch (Exception e) { e.printStackTrace(); throw new BuildException(e); } finally { _rootSource.removePageSource(ps); } } }jxp-1.6.1/src/java/org/onemind/jxp/ArrayAssignable.java100644 0 0 2773 10530435353 20124 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.lang.reflect.Array; /** * An array wrapper * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class ArrayAssignable implements Assignable { /** the array object **/ private Object _arrayObj; /** the dimension **/ private int _idx; /** * Constructor * @param dims the dimensions */ public ArrayAssignable(Object arrayObj, int idx) { _arrayObj = arrayObj; _idx = idx; } /** * {@inheritDoc} */ public Object assign(Object value) { Array.set(_arrayObj, _idx, value); return value; } }jxp-1.6.1/src/java/org/onemind/jxp/Assignable.java100644 0 0 2235 10530435352 17115 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * Something that can be assigned value to * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public interface Assignable { /** * Assing the value to this assignable * @param value the value * @return the original value */ public Object assign(Object value); }jxp-1.6.1/src/java/org/onemind/jxp/ByteArrayPageSource.java100644 0 0 3632 10530435352 20727 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.*; import java.util.HashMap; import java.util.Map; import org.onemind.jxp.parser.AstJxpDocument; public class ByteArrayPageSource extends CachingPageSource { private Map _buffers = new HashMap(); protected AstJxpDocument parseJxpDocument(JxpPage page) throws JxpPageParseException { // TODO Auto-generated method stub return null; } public void putPageBuffer(String id, byte[] buffer) { _buffers.put(id, buffer); } protected boolean isExpired(CachedJxpPage page) { return false; } protected boolean hasStream(String pageName) { return _buffers.get(pageName) != null; } protected InputStream loadStream(CachedJxpPage page) throws IOException { byte[] buffer = (byte[]) _buffers.get(page.getName()); if (buffer == null) { throw new IOException("Page " + page.getName() + " not found"); } else { return new ByteArrayInputStream(buffer); } } } jxp-1.6.1/src/java/org/onemind/jxp/CachedJxpPage.java100644 0 0 4714 10530435353 17500 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * Represent a cached page source * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public final class CachedJxpPage extends JxpPage { /** the source specific page timestamp **/ private long _pageTimestamp; /** * {@inheritDoc} */ public CachedJxpPage(JxpPageSource source, String name, String encoding) { super(source, name, encoding); } /** * Return the timestamp * @return the page timestamp. */ public final long getPageTimestamp() { return _pageTimestamp; } /** * Set the timestamp * @param pageTimestamp The timestamp. */ public final void setPageTimepstamp(long pageTimestamp) { _pageTimestamp = pageTimestamp; } /** * {@inheritDoc} */ public final Object declareStaticVariable(String name, Object value) { return ((CachingPageSource) getSource()).declarePageStaticVariable(this, name, value); } /** * {@inheritDoc} */ public final boolean hasStaticVariable(String name) { return ((CachingPageSource) getSource()).hasPageStaticVariable(this, name); } /** * {@inheritDoc} */ public final Object getStaticVariable(String name) { return ((CachingPageSource) getSource()).getPageStaticVariable(this, name); } /** * {@inheritDoc} */ public Object assignStaticVariable(String name, Object value) { return ((CachingPageSource) getSource()).assignPageStaticVariable(this, name, value); } }jxp-1.6.1/src/java/org/onemind/jxp/CachingPageSource.java100644 0 0 24352 10530435352 20403 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.*; import java.util.HashMap; import java.util.Iterator; import org.onemind.commons.java.datastructure.MruMap; import org.onemind.jxp.parser.*; /** * A caching page source will cache the page source * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public abstract class CachingPageSource extends JxpPageSource { /** the cache * */ private MruMap _pageCache; /** flag to turn caching on/off * */ private boolean _caching = true; /** whether invalidate the cache on parse error * */ private boolean _invalidateCacheOnParseError = false; /** the page static variables **/ private HashMap _pageStaticVariables = new HashMap(); /** the encoding **/ private String _encoding; /** * Constructor * (default use 200 cache limit, unlimit timeout) */ public CachingPageSource() { this(200); } /** * Constructor * @param cacheSize The default cache size */ public CachingPageSource(int cacheSize) { this(cacheSize, 0); } /** * Constructor * @param cacheSize The default cache size * @param timeout time to expire inactive cache */ public CachingPageSource(int cacheSize, int timeout) { _pageCache = new MruMap(cacheSize, timeout); } /** * {@inheritDoc} */ public final JxpPage getJxpPage(String id) throws JxpPageNotFoundException { JxpPage page = null; if (_caching) { page = (JxpPage) _pageCache.get(id); if (page != null) { return page; } } if (hasStream(id)) { page = new CachedJxpPage(this, id, getEncoding()); } else { throw new JxpPageNotFoundException("Page " + id + " not found"); } // TODO: synchronize by id so that no two same JxpPage will be loaded if (_caching && page != null) { _pageCache.put(id, page); } return page; } /** * Invalidate the page cache * @param page the page */ protected final void invalidatePageCache(JxpPage page) { _pageCache.put(page.getName(), null); } /** * Return whether this is doing caching * @return true if caching */ public final boolean isCaching() { return _caching; } /** * Set caching on/off * @param b true if caching on */ public final void setCaching(boolean b) { _caching = b; } /** * {@inheritDoc} */ public final AstJxpDocument getJxpDocument(JxpPage page) throws JxpPageParseException { CachedJxpPage cachedPage = (CachedJxpPage) page; boolean expired = false; if (cachedPage.getDocument() == null || (expired = isExpired(cachedPage))) { if (expired) { cachedPage.setParseException(null); cachedPage.setDocument(null); purgeStaticVariables(cachedPage); } else { if (cachedPage.hasParseError()) { throw cachedPage.getParseException(); } } //need to parse it synchronized (cachedPage) //synchronize { if (cachedPage.getDocument() == null) // no one has parse it since the before synchronize { //check one more time to make sure no previous locker has done it if (cachedPage.hasParseError()) { //still have problem throw cachedPage.getParseException(); } //otherwise reparse try { try { InputStream in = loadStream(cachedPage); JxpParser parser = (getEncoding() == null) ? new JxpParser(in) : new JxpParser(new InputStreamReader( in, getEncoding())); AstJxpDocument doc = parser.JxpDocument(); cachedPage.setDocument(doc); return doc; } catch (ParseException e) { String message = "Problem parsing page " + page.getName() + ": " + e.getMessage(); throw new JxpPageParseException(message, e); } catch (IOException e) { throw new JxpPageParseException("Problem parsing page " + page.getName() + ": " + e.getMessage(), e); } } catch (JxpPageParseException e) { cachedPage.setParseException(e); //TODO: determine if this is needed if (_invalidateCacheOnParseError) { invalidatePageCache(page); } //rethrow throw e; } } } } return cachedPage.getDocument(); } /** * Whether a page is expired * @param page the page * @return true if expired */ protected abstract boolean isExpired(CachedJxpPage page); /** * Whether there's input stream from given page name * @param pageName the page name * @return true if has input stream */ protected abstract boolean hasStream(String pageName); /** * Load the input stream for the page * @param pageName the page * @return the input stream */ protected abstract InputStream loadStream(CachedJxpPage page) throws IOException; /** * Whehter the page identified by id is cached * @param id the id * @return true if cached */ public final boolean isJxpPageCached(String id) { return _pageCache.containsKey(id); } /** * Declare a page static variable * @param page the page * @param name the name * @param value the value */ /* package */final Object declarePageStaticVariable(JxpPage page, String name, Object value) { String fullName = page.getName() + "." + name; if (_pageStaticVariables.containsKey(fullName)) { throw new IllegalArgumentException("Static variable " + name + " has been declared"); } else { return _pageStaticVariables.put(fullName, value); } } /** * Return whether there's a variable declared * @param page the page * @param name the name * @return true if declared */ /* package */final boolean hasPageStaticVariable(JxpPage page, String name) { String fullName = page.getName() + "." + name; return _pageStaticVariables.containsKey(fullName); } /** * Get the page static variable * @param page the page * @param name the nama * @return the value */ /* package */final Object getPageStaticVariable(JxpPage page, String name) { String fullName = page.getName() + "." + name; return _pageStaticVariables.get(fullName); } /** * {@inheritDoc} */ public StringBuffer getErrorSource(JxpPage page, int line, int col) throws IOException { StringBuffer sb = new StringBuffer("Error at page "); sb.append(page.getName()); sb.append(" at line "); sb.append(line); sb.append(", column "); sb.append(col); return sb; } /** * @param page * @param name * @param value * @return */ /* package */final Object assignPageStaticVariable(CachedJxpPage page, String name, Object value) { String fullName = page.getName() + "." + name; if (!_pageStaticVariables.containsKey(fullName)) { throw new IllegalArgumentException("Static variable " + name + " has not been declared"); } else { return _pageStaticVariables.put(fullName, value); } } /** * Purge the static variables for a page * @param page the page */ protected final void purgeStaticVariables(CachedJxpPage page) { Iterator it = _pageStaticVariables.keySet().iterator(); String prefix = page.getName() + "."; while (it.hasNext()) { String key = (String) it.next(); if (key.startsWith(prefix)) { _pageStaticVariables.remove(key); } } } /** * Set the encoding * @param encoding the encoding */ public final void setEncoding(String encoding) { _encoding = encoding; } /** * Return the encoding * @return the encoding */ public final String getEncoding() { return _encoding; } /** * {@inheritDoc} */ public final boolean hasJxpPage(String id) { return ((_caching && _pageCache.containsKey(id)) || hasStream(id)); } }jxp-1.6.1/src/java/org/onemind/jxp/config/CachingPageSourceDigester.java100644 0 0 4321 10530435356 23315 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.config; import org.onemind.commons.java.util.ObjectUtils; import org.onemind.commons.java.xml.digest.AbstractElementCreatorDigester; import org.onemind.commons.java.xml.digest.SaxDigesterHandler; import org.onemind.jxp.CachingPageSource; import org.xml.sax.Attributes; import org.xml.sax.SAXException; /** * A FileSourceDigester digest "filesource" element in an xml to create a JxpFilePageSource object * @author TiongHiang Lee (thlee@onemindsoft.org) */ public abstract class CachingPageSourceDigester extends AbstractElementCreatorDigester { /** * {@inheritDoc} */ public CachingPageSourceDigester(String name) { super(name); } /** * {@inheritDoc} */ public final void startDigest(SaxDigesterHandler handler, Attributes attrs) throws SAXException { CachingPageSource source = createPageSource(handler, attrs); String caching = attrs.getValue("caching"); String encoding = attrs.getValue("encoding"); source.setCaching(ObjectUtils.toBool(caching, false)); source.setEncoding(encoding); setCreatedElement(source); } /** * @param handler * @param attrs * @return */ protected abstract CachingPageSource createPageSource(SaxDigesterHandler handler, Attributes attrs) throws SAXException; }jxp-1.6.1/src/java/org/onemind/jxp/config/FileSourceDigester.java100644 0 0 4231 10530435353 22040 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.config; import org.onemind.commons.java.util.StringUtils; import org.onemind.commons.java.xml.digest.SaxDigesterHandler; import org.onemind.jxp.CachingPageSource; import org.onemind.jxp.FilePageSource; import org.xml.sax.Attributes; import org.xml.sax.SAXException; /** * A FileSourceDigester digest "filesource" element in an xml to create a JxpFilePageSource object * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class FileSourceDigester extends CachingPageSourceDigester { /** * Constructor */ public FileSourceDigester() { super("filesource"); } /** * {@inheritDoc} */ public CachingPageSource createPageSource(SaxDigesterHandler handler, Attributes attrs) throws SAXException { String prefix = attrs.getValue("path"); if (StringUtils.isNullOrEmpty(prefix)) { throw new IllegalArgumentException("Expecing \"path\" attribute in " + handler.getCurrentPath()); } else { FilePageSource source = new FilePageSource(prefix); String modCheck = attrs.getValue("modcheck"); if (modCheck != null && modCheck.equals("true")) { source.setModCheck(true); } return source; } } }jxp-1.6.1/src/java/org/onemind/jxp/config/JxpConfigDigester.java100644 0 0 6367 10530435354 21704 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.config; import java.util.HashMap; import java.util.Map; import org.onemind.commons.java.datastructure.XmlPropertyElementDigester; import org.onemind.commons.java.util.ObjectUtils; import org.onemind.commons.java.xml.digest.*; import org.onemind.jxp.*; import org.xml.sax.Attributes; import org.xml.sax.SAXException; /** * JxpConfigDigester digest jxp configuration * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class JxpConfigDigester extends AbstractElementCreatorDigester implements ElementListener { /** the processor **/ private JxpProcessor _processor; /** the environment **/ private Map _env; /** do method statistics **/ private boolean _doMethodStats; /** * Constructor */ public JxpConfigDigester() { super("jxp"); } /** * {@inheritDoc} */ public void startDigest(SaxDigesterHandler handler, Attributes attr) throws SAXException { _doMethodStats = ObjectUtils.toBool(attr.getValue("methodstats"), false); _env = new HashMap(); XmlPropertyElementDigester pDig = new XmlPropertyElementDigester("var", _env); handler.addSubDigester("env", pDig); String pageSourcePath = "pagesources"; MultiSourceDigester dig = new MultiSourceDigester(); dig.addListener(this); handler.addSubDigester(pageSourcePath, dig); FileSourceDigester fdig = new FileSourceDigester(); fdig.addListener(this); handler.addSubDigester(pageSourcePath, fdig); StreamSourceDigester sdig = new StreamSourceDigester(); sdig.addListener(this); handler.addSubDigester(pageSourcePath, sdig); } /** * {@inheritDoc} */ public void objectCreated(Object obj) { _processor = new JxpProcessor(new JxpContext((JxpPageSource) obj, _env)); _processor.setDoMethodStats(_doMethodStats); setCreatedElement(_processor); } /** * Return the created processor * @return the processor */ public JxpProcessor getProcessor() { return _processor; } /** * {@inheritDoc} */ public void endDigest(SaxDigesterHandler handler) throws SAXException { if (_processor == null) { throw new SAXException("Jxp processor config is missing in the config"); } } }jxp-1.6.1/src/java/org/onemind/jxp/config/MultiSourceDigester.java100644 0 0 4356 10530435355 22265 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.config; import org.onemind.commons.java.xml.digest.*; import org.onemind.jxp.JxpPageSource; import org.onemind.jxp.MultiSourcePageSource; import org.xml.sax.Attributes; import org.xml.sax.SAXException; /** * TODO comment * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class MultiSourceDigester extends AbstractElementCreatorDigester implements ElementListener { /** the multi source page source created **/ private MultiSourcePageSource _source; /** * Constructor */ public MultiSourceDigester() { super("multisource"); } /** * {@inheritDoc} */ public void startDigest(SaxDigesterHandler handler, Attributes attr) throws SAXException { _source = new MultiSourcePageSource(); // setup multi MultiSourceDigester dig = new MultiSourceDigester(); dig.addListener(this); handler.addSubDigester(dig); FileSourceDigester fdig = new FileSourceDigester(); fdig.addListener(this); handler.addSubDigester(fdig); StreamSourceDigester sdig = new StreamSourceDigester(); sdig.addListener(this); handler.addSubDigester(sdig); setCreatedElement(_source); } /** * {@inheritDoc} */ public void objectCreated(Object obj) { _source.addPageSource((JxpPageSource) obj); } }jxp-1.6.1/src/java/org/onemind/jxp/config/StreamSourceDigester.java100644 0 0 3704 10530435354 22421 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.config; import org.onemind.commons.java.util.StringUtils; import org.onemind.commons.java.xml.digest.SaxDigesterHandler; import org.onemind.jxp.CachingPageSource; import org.onemind.jxp.ResourceStreamPageSource; import org.xml.sax.Attributes; import org.xml.sax.SAXException; /** * A FileSourceDigester digest "filesource" element in an xml to create a JxpFilePageSource object * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class StreamSourceDigester extends CachingPageSourceDigester { /** * Constructor */ public StreamSourceDigester() { super("streamsource"); } /** * {@inheritDoc} */ public CachingPageSource createPageSource(SaxDigesterHandler handler, Attributes attrs) throws SAXException { String prefix = attrs.getValue("path"); if (StringUtils.isNullOrEmpty(prefix)) { throw new IllegalArgumentException("Expecing \"path\" attribute in " + handler.getCurrentPath()); } else { return new ResourceStreamPageSource(prefix); } } }jxp-1.6.1/src/java/org/onemind/jxp/Control.java100644 0 0 3401 10530435355 16464 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * Represent a control object in the script language * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class Control { /** reference to an object * */ private Object _obj; /** the break control * */ public static final Control BREAK = new Control(); /** the continue control * */ public static final Control CONTINUE = new Control(); /** the return control * */ public static final Control RETURN = new Control(); /** the exit **/ public static final Control EXIT = new Control(); /** * {@inheritDoc} */ private Control() { } /** * {@inheritDoc} * @param obj an object */ public Control(Object obj) { _obj = obj; } /** * Get the object * @return the object */ public Object getObject() { return _obj; } }jxp-1.6.1/src/java/org/onemind/jxp/Evaluator.java100644 0 0 42211 10530435353 17026 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import org.onemind.commons.java.lang.Null; /** * The evaluator implements several arithmetic operations on objects * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public final class Evaluator { /** the precision of parameters * */ private static final short INT_PRECISION = 0, FLOAT_PRECISION = 1, LONG_PRECISION = 2, DOUBLE_PRECISION = 3; /** * Constructor */ private Evaluator() { } /** * Plus operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object plus(Object a1, Object a2) { if (a1 instanceof String || a1 instanceof Character){ return a1.toString() + a2; } else if (a2 instanceof String || a2 instanceof Character){ return a1 + a2.toString(); } Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return new Integer(n1.intValue() + n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() + n2.longValue()); case FLOAT_PRECISION : return new Float(n1.floatValue() + n2.floatValue()); case DOUBLE_PRECISION : return new Double(n1.doubleValue() + n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Get the higest precision among the two number * @param n1 the first number * @param n2 the second numbe r * @return the highest precision */ private static short getPrecision(Number n1, Number n2) { if (n1 instanceof Double || n2 instanceof Double) { return DOUBLE_PRECISION; } else if (n1 instanceof Float || n2 instanceof Float) { return FLOAT_PRECISION; } else if (n1 instanceof Long || n2 instanceof Long) { return LONG_PRECISION; } else { //if (n1 instanceof Integer || n2 instanceof Integer) { return INT_PRECISION; } } /** * Cast the object to a number * @param o the object * @return a number object */ private static Number toNumber(Object o) { if (o instanceof Number) { return (Number) o; } else { throw new IllegalArgumentException(o + " is not a number"); } } /** * Minus operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object minus(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return new Integer(n1.intValue() - n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() - n2.longValue()); case FLOAT_PRECISION : return new Float(n1.floatValue() - n2.floatValue()); case DOUBLE_PRECISION : return new Double(n1.doubleValue() - n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Multiply operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object multiply(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return new Integer(n1.intValue() * n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() * n2.longValue()); case FLOAT_PRECISION : return new Float(n1.floatValue() * n2.floatValue()); case DOUBLE_PRECISION : return new Double(n1.doubleValue() * n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Divide operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object divide(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return new Integer(n1.intValue() / n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() / n2.longValue()); case FLOAT_PRECISION : return new Float(n1.floatValue() / n2.floatValue()); case DOUBLE_PRECISION : return new Double(n1.doubleValue() / n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Remainder operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object remainder(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return new Integer(n1.intValue() % n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() % n2.longValue()); case FLOAT_PRECISION : return new Float(n1.floatValue() % n2.floatValue()); case DOUBLE_PRECISION : return new Double(n1.doubleValue() % n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Negation operation * @param a1 the first arg * @return the result */ public static Object negate(Object a1) { Number n1 = toNumber(a1); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(-n1.intValue()); case LONG_PRECISION : return new Long(-n1.longValue()); case FLOAT_PRECISION : return new Float(-n1.floatValue()); case DOUBLE_PRECISION : return new Double(-n1.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Equality operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Boolean eq(Object a1, Object a2) { if (a1 instanceof Number && a2 instanceof Number) { return Boolean.valueOf(a1.equals(a2)); } else if (a1 instanceof Boolean && a2 instanceof Boolean) { return Boolean.valueOf(a1.equals(a2)); } else if ((a1 == null || a1 == Null.instance) && (a2 == null || a2 == Null.instance)) { return Boolean.TRUE; } else if (a1 instanceof Character && a2 instanceof Character){ return Boolean.valueOf(a1.equals(a2)); } else { return Boolean.valueOf(a1 == a2); } } /** * Inequality operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Boolean ne(Object a1, Object a2) { if (a1 instanceof Number && a2 instanceof Number) { return Boolean.valueOf(!a1.equals(a2)); } else if (a1 instanceof Boolean && a2 instanceof Boolean) { return Boolean.valueOf(!a1.equals(a2)); } else if ((a1 == null || a1 == Null.instance) && (a2 == null || a2 == Null.instance)) { return Boolean.FALSE; } else { return Boolean.valueOf(a1 != a2); } } /** * Less than operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Boolean lt(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return Boolean.valueOf(n1.intValue() < n2.intValue()); case LONG_PRECISION : return Boolean.valueOf(n1.longValue() < n2.longValue()); case FLOAT_PRECISION : return Boolean.valueOf(n1.floatValue() < n2.floatValue()); case DOUBLE_PRECISION : return Boolean.valueOf(n1.doubleValue() < n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Less than or equal operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Boolean le(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return Boolean.valueOf(n1.intValue() <= n2.intValue()); case LONG_PRECISION : return Boolean.valueOf(n1.longValue() <= n2.longValue()); case FLOAT_PRECISION : return Boolean.valueOf(n1.floatValue() <= n2.floatValue()); case DOUBLE_PRECISION : return Boolean.valueOf(n1.doubleValue() <= n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Greater than operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Boolean gt(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return Boolean.valueOf(n1.intValue() > n2.intValue()); case LONG_PRECISION : return Boolean.valueOf(n1.longValue() > n2.longValue()); case FLOAT_PRECISION : return Boolean.valueOf(n1.floatValue() > n2.floatValue()); case DOUBLE_PRECISION : return Boolean.valueOf(n1.doubleValue() > n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Greater than or equal operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Boolean ge(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n2)) { case INT_PRECISION : return Boolean.valueOf(n1.intValue() >= n2.intValue()); case LONG_PRECISION : return Boolean.valueOf(n1.longValue() >= n2.longValue()); case FLOAT_PRECISION : return Boolean.valueOf(n1.floatValue() >= n2.floatValue()); case DOUBLE_PRECISION : return Boolean.valueOf(n1.doubleValue() >= n2.doubleValue()); default : throw new InternalError("Internal error"); } } /** * Cast the given object to boolean type * @param o the object * @return boolean type */ public static Boolean toBoolean(Object o) { if (o instanceof Boolean) { return (Boolean) o; } else { throw new IllegalArgumentException(o + " is not boolean"); } } /** * Bitwise complement operation * @param o the object * @return the result */ public static Object bitwiseComplement(Object o) { Number n1 = toNumber(o); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(~n1.intValue()); case LONG_PRECISION : return new Long(~n1.longValue()); default : throw new IllegalArgumentException( "Cannot apply bitwise complement operation on float/double value"); } } /** * Left-shift operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object leftShift(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(n1.intValue() << n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() << n2.intValue()); default : throw new IllegalArgumentException( "Cannot apply << operator on float/double value"); } } /** * right-signed-shift operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object rightSignedShift(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(n1.intValue() >> n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() >> n2.intValue()); default : throw new IllegalArgumentException( "Cannot apply >> operator on float/double value"); } } /** * Right-unsigned-shift operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object rightUnsignedShift(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(n1.intValue() >>> n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() >>> n2.intValue()); default : throw new IllegalArgumentException( "Cannot apply >>> operator on float/double value"); } } /** * Bitwise-and operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object bitwiseAnd(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(n1.intValue() & n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() & n2.intValue()); default : throw new IllegalArgumentException( "Cannot apply & operator on float/double value"); } } /** * Bitwise-or operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object bitwiseOr(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(n1.intValue() | n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() | n2.intValue()); default : throw new IllegalArgumentException( "Cannot apply | operator on float/double value"); } } /** * Bitwise-XOR operation * @param a1 the first arg * @param a2 the second arg * @return the result */ public static Object bitwiseXOr(Object a1, Object a2) { Number n1 = toNumber(a1), n2 = toNumber(a2); switch (getPrecision(n1, n1)) { case INT_PRECISION : return new Integer(n1.intValue() ^ n2.intValue()); case LONG_PRECISION : return new Long(n1.longValue() ^ n2.intValue()); default : throw new IllegalArgumentException( "Cannot apply ^ operator on float/double value"); } } }jxp-1.6.1/src/java/org/onemind/jxp/FilePageSource.java100644 0 0 6422 10530435354 17706 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.*; import org.onemind.commons.java.util.FileUtils; import org.onemind.jxp.parser.*; /** * Represents a JxpPageSource using the file system * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class FilePageSource extends CachingPageSource { /** do modification check **/ private boolean _modCheck; /** the path prefix * */ private String _pathPrefix; /** * Constructor * @param pathPrefix the prefix */ public FilePageSource(String pathPrefix) { _pathPrefix = pathPrefix; } /** * Constructor * @param pathPrefix the path prefix * @param encoding the encoding */ public FilePageSource(String pathPrefix, String encoding) { this(pathPrefix); setEncoding(encoding); } /** * {@inheritDoc} */ public final String getStreamName(String pageName) { return FileUtils.concatFilePath(getPathPrefix(), pageName); } /** * Return the pathPrefix * @return the pathPrefix. */ public final String getPathPrefix() { return _pathPrefix; } /** * Set the pathPrefix * @param pathPrefix The pathPrefix to set. */ public final void setPathPrefix(String pathPrefix) { _pathPrefix = pathPrefix; } /** * Return whether doing file modification check * @return true if modification check is turned on */ public boolean getModCheck() { return _modCheck; } /** * Set whether to do file modification check * @param b true to turn on modification check */ public void setModCheck(boolean b) { _modCheck = true; } /** * {@inheritDoc} */ protected boolean isExpired(CachedJxpPage page) { File f = new File(getStreamName(page.getName())); return (page.getPageTimestamp() != f.lastModified()); } /** * {@inheritDoc} */ protected boolean hasStream(String pageName) { return new File(getStreamName(pageName)).exists(); } /** * {@inheritDoc} */ protected InputStream loadStream(CachedJxpPage page) throws IOException { File f = new File(getStreamName(page.getName())); page.setPageTimepstamp(f.lastModified()); return new FileInputStream(f); } }jxp-1.6.1/src/java/org/onemind/jxp/JxpContext.java100644 0 0 4642 10530435354 17161 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.Writer; import java.util.*; /** * A jxp context encapsulate the pagesource and default environment. * It creates the JxpProcessingContext to the JxpProcessor. * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class JxpContext { /** the page source **/ private final JxpPageSource _source; /** the default environment **/ private final Map _defaultEnv; /** * Constructor * @param source the page source */ public JxpContext(JxpPageSource source) { this(source, Collections.EMPTY_MAP); } /** * Constructor * @param source the source * @param env the environment */ public JxpContext(JxpPageSource source, Map defaultEnv) { _source = source; _defaultEnv = defaultEnv; } /** * Get the page source * @return the page source */ public JxpPageSource getPageSource() { return _source; } /** * Get the environment * @return the environment */ public Map getEnvironment() { return _defaultEnv; } /** * Create processing context * @param page the page */ public JxpProcessingContext createProcessingContext(Map pageEnv, Writer writer) throws Exception { HashMap env = new HashMap(_defaultEnv); env.putAll(pageEnv); env.put("writer", writer); JxpProcessingContext context = new JxpProcessingContext(writer, env); return context; } }jxp-1.6.1/src/java/org/onemind/jxp/JxpFactory.java100644 0 0 7220 10530435352 17135 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.*; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.onemind.commons.java.xml.digest.SaxDigesterHandler; import org.onemind.jxp.config.JxpConfigDigester; import org.xml.sax.SAXException; /** * The JxpPageSource factory * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public final class JxpFactory { /** the parser * */ private static SAXParser _parser; /** * Constructor */ private JxpFactory() { } /** * set up * @return the parser * @throws Exception if there's problem */ private static SAXParser getParser() throws Exception { if (_parser == null) { SAXParserFactory factory = SAXParserFactory.newInstance(); _parser = factory.newSAXParser(); } return _parser; } /** * Get the page source from the config * @param configFile the config * @return the config * @throws IOException if there's IO problem * @throws SAXException if there's parsing exception * @throws Exception if there's other problem */ public static JxpPageSource getPageSource(String configFile) throws SAXException, IOException, Exception { // PageSourceDigesterElement config = new PageSourceDigesterElement(); // SaxDigesterHandler handler = new SaxDigesterHandler(); // handler.addDigester(config); // getParser().parse(new File(configFile), handler); // return config.getPageSource(); return null; } /** * Get the processor from the config * @param configFile the config * @return the processor * @throws IOException if there's IO problem * @throws SAXException if there's parsing problem * @throws Exception if there's other problem */ public static JxpProcessor getProcessor(String configFile) throws SAXException, IOException, Exception { return getProcessor(new FileInputStream(configFile)); } /** * Get the processor from the config * @param config the config input stream * @return the processor * @throws IOException if there's IO problem * @throws SAXException if there's parsing problem * @throws Exception if there's other problem */ public static JxpProcessor getProcessor(InputStream config) throws SAXException, IOException, Exception { SaxDigesterHandler handler = new SaxDigesterHandler(); SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); JxpConfigDigester dig = new JxpConfigDigester(); handler.addDigester(dig); parser.parse(config, handler); return dig.getProcessor(); } }jxp-1.6.1/src/java/org/onemind/jxp/JxpInvocable.java100644 0 0 2102 10530435354 17424 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import org.onemind.commons.invoke.Invocable; /** * An tagging interface for self invocable in jxp script * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public interface JxpInvocable extends Invocable { }jxp-1.6.1/src/java/org/onemind/jxp/JxpPage.java100644 0 0 10056 10530435352 16423 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import org.onemind.jxp.parser.AstJxpDocument; /** * Represent an JXPPage. It has a name and hold reference to the AST structure * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public abstract class JxpPage { /** the source * */ private JxpPageSource _source; /** the name * */ private String _name; /** the document * */ private AstJxpDocument _doc; /** the error message * */ private JxpPageParseException _pageParseException; /** the encoding **/ private String _encoding; /** * Constructor * @param source the source * @param name the name */ public JxpPage(JxpPageSource source, String name, String encoding) { _source = source; _name = name; _encoding = encoding; } /** * Get the name * @return the name */ public final String getName() { return _name; } /** * Get the JxpDocument tree structure * @return the document tree structure * @throws JxpPageSourceException if there's problem creating the document tree */ public final AstJxpDocument getJxpDocument() throws JxpPageSourceException { return _source.getJxpDocument(this); } /** * Get the source * @return the source */ public final JxpPageSource getSource() { return _source; } /** * Return the doc * @return the doc. */ public final AstJxpDocument getDocument() { return _doc; } /** * Set the doc * @param doc The doc to set. */ public final void setDocument(AstJxpDocument doc) { _doc = doc; } /** * @param s * @return */ public abstract Object declareStaticVariable(String s, Object value); /** * @param s * @return */ public abstract boolean hasStaticVariable(String s); /** * @param s * @return */ public abstract Object getStaticVariable(String s); /** * @param name * @param value */ public abstract Object assignStaticVariable(String name, Object value); /** * Return the hasParseError * @return the hasParseError. */ public final boolean hasParseError() { return _pageParseException != null; } /** * Set the pageParseException * @param pageParseException The pageParseException to set. */ public final void setParseException(JxpPageParseException pageParseException) { _pageParseException = pageParseException; } /** * Return the pageParseException * @return the pageParseException. */ public final JxpPageParseException getParseException() { return _pageParseException; } /** * Return the encoding * @return the encoding. */ public final String getEncoding() { return _encoding; } /** * Set the encoding * @param encoding The encoding to set. */ public final void setEncoding(String encoding) { _encoding = encoding; } }jxp-1.6.1/src/java/org/onemind/jxp/JxpPageNotFoundException.java100644 0 0 3065 10530435353 21742 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * Exception when JxpPage is not found * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public final class JxpPageNotFoundException extends JxpPageSourceException { /** * Constructor */ public JxpPageNotFoundException() { super(); } /** * {@inheritDoc} */ public JxpPageNotFoundException(String message) { super(message); } /** * {@inheritDoc} */ public JxpPageNotFoundException(String message, Throwable cause) { super(message, cause); } /** * {@inheritDoc} */ public JxpPageNotFoundException(Throwable cause) { super(cause); } }jxp-1.6.1/src/java/org/onemind/jxp/JxpPageParseException.java100644 0 0 3030 10530435353 21250 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * Represent a parse exception * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class JxpPageParseException extends JxpPageSourceException { /** * Constructor */ public JxpPageParseException() { super(); } /** * {@inheritDoc} */ public JxpPageParseException(String message) { super(message); } /** * {@inheritDoc} */ public JxpPageParseException(String message, Throwable cause) { super(message, cause); } /** * {@inheritDoc} */ public JxpPageParseException(Throwable cause) { super(cause); } }jxp-1.6.1/src/java/org/onemind/jxp/JxpPageSource.java100644 0 0 4372 10530435356 17574 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.IOException; import org.onemind.jxp.parser.AstJxpDocument; /** * Represent the source of JxpPages. It contains multiple JxpPages identified by the ids * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public abstract class JxpPageSource { /** * Return whether the jxp page identified by the id exists * @param id the id * @return true if exists */ public abstract boolean hasJxpPage(String id); /** * Return a jxp page identified by the id * @param id the id * @return the jxp page * @throws JxpPageNotFoundException if the page cannot be found */ public abstract JxpPage getJxpPage(String id) throws JxpPageNotFoundException; /** * Print the error source of this page on given line and column * @param page the page * @param line the line * @param col the column * @return the StringBuffer * @throws IOException if there's IO problem */ public abstract StringBuffer getErrorSource(JxpPage page, int line, int col) throws IOException; /** * Get the jxp document for the JxpPage * @param page the JxpPage * @return the AstJxpDocument * @throws JxpPageSourceException if there's source exception */ public abstract AstJxpDocument getJxpDocument(JxpPage page) throws JxpPageSourceException; }jxp-1.6.1/src/java/org/onemind/jxp/JxpPageSourceException.java100644 0 0 3032 10530435355 21442 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * A Exception regarding JxpPageSource * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class JxpPageSourceException extends Exception { /** * {@inheritDoc} */ public JxpPageSourceException() { super(); } /** * {@inheritDoc} */ public JxpPageSourceException(String message) { super(message); } /** * {@inheritDoc} */ public JxpPageSourceException(String message, Throwable cause) { super(message, cause); } /** * {@inheritDoc} */ public JxpPageSourceException(Throwable cause) { super(cause); } }jxp-1.6.1/src/java/org/onemind/jxp/JxpProcessingContext.java100644 0 0 13710 10530435353 21231 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.Writer; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import org.onemind.commons.java.datastructure.NametableStack; import org.onemind.commons.java.lang.reflect.ClassLookupCache; import org.onemind.jxp.util.StaticImport; /** * An processing context contains everything specific to a specific execution of an JxpPage so that there's only one parser needed * for all the processings * @author TiongHiang Lee (thlee@onemindsoft.org) * */ class JxpProcessingContext { /** the logger * */ private static final Logger _logger = Logger.getLogger(JxpProcessingContext.class.getName()); /** default imports * */ private static final ClassLookupCache _default_imports = new ClassLookupCache(); static { _default_imports.addImport("*"); _default_imports.addImport("java.lang.*"); _default_imports.addImport("java.util.*"); } private static final String KEY_SCRIPT_NAME = "jxp_script_name"; private static final String KEY_WRITER = "jxp_writer"; private static final String KEY_CONTEXT = "jxp_context"; /** the imports * */ private ClassLookupCache _imports = new ClassLookupCache(); /** the writer * */ private Writer _writer; /** the stack of pages in current processing context * */ private Stack _pageStack = new Stack(); /** the nametable scope stack **/ private Stack _ntStack = new Stack(); /** the current page **/ private JxpPage _currentPage; /** the name tables * */ private NametableStack _nametableStack; /** the functions map **/ private Map _userDefinedFunctions = new HashMap(); /** the static imports **/ private List _staticImports = new ArrayList(); /** * {@inheritDoc} */ public JxpProcessingContext(Writer writer, Map env) { _writer = writer; env.put(KEY_WRITER, _writer); env.put(KEY_CONTEXT, this); _nametableStack = new NametableStack(env); }; /** * Push current page to the page stack * @param page the page */ public final void pushPage(JxpPage page) { _currentPage = page; _pageStack.push(page); if (_nametableStack.containsName(KEY_SCRIPT_NAME)) { _nametableStack.assign(KEY_SCRIPT_NAME, page.getName()); } else { _nametableStack.declare(KEY_SCRIPT_NAME, page.getName()); } } /** * Get the current page * @return the current page */ public final JxpPage getCurrentPage() { return _currentPage; } /** * Pop the current page * @param page the current page * @throws IllegalStateException if the page is not current page */ public final void popPage(JxpPage page) throws IllegalStateException { if (_pageStack.peek() != page) { throw new IllegalStateException("Popping wrong page " + page); } else { _pageStack.pop(); if (_pageStack.size() != 0) { _currentPage = (JxpPage) _pageStack.peek(); } else { _currentPage = null; } if (_currentPage!=null) { _nametableStack.assign(KEY_SCRIPT_NAME, _currentPage.getName()); } } } /** * Resolve a class * @param className the class name * @return the class */ protected final Class resolveClass(String className) { if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Resolving " + className); } Class c = _default_imports.getClass(className); if (c == null) { if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Resolving " + className + " package " + _imports.getPackages()); } c = _imports.getClass(className); } return c; } /** * Return the name table stack * @return the name table stack */ public final NametableStack getNametableStack() { return _nametableStack; } /** * Return the imports * @return the imports */ public final ClassLookupCache getImports() { return _imports; } /** * Get the writer * @return the writer */ public final Writer getWriter() { return _writer; } /** * Return the functions * @return the functions. */ public final Map getUserDefinedFunctions() { return _userDefinedFunctions; } /** * Add static import * @param sImport the static import to add */ public void addStaticImport(StaticImport sImport) { _staticImports.add(sImport); } /** * Get static imports * @return the static imports */ public final List getStaticImports() { return _staticImports; } }jxp-1.6.1/src/java/org/onemind/jxp/JxpProcessingContext.java.rej100644 0 0 1522 10530435352 21765 0ustar 0 0 @@ -23,16 +23,17 @@ import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; -import org.onemind.commons.invoke.DefaultInvocable; +import org.onemind.commons.invoke.AbstractInvocable; import org.onemind.commons.java.datastructure.NametableStack; import org.onemind.commons.java.lang.reflect.ClassLookupCache; +import org.onemind.jxp.util.StaticImport; /** * An processing context contains everything specific to a specific execution of an JxpPage so that there's only one parser needed * for all the processings * @author TiongHiang Lee (thlee@onemindsoft.org) * @version $Id: JxpProcessingContext.java,v 1.9 2004/10/31 16:44:30 thlee Exp $ $Name: $ */ -public class JxpProcessingContext extends DefaultInvocable +public class JxpProcessingContext extends AbstractInvocable { /** the logger * */ jxp-1.6.1/src/java/org/onemind/jxp/JxpProcessor.java100644 0 0 252746 10530435354 17566 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.*; import java.lang.reflect.*; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import org.onemind.commons.invoke.InvocableFunction; import org.onemind.commons.java.datastructure.NametableStack; import org.onemind.commons.java.datastructure.ThreadLocalStack; import org.onemind.commons.java.lang.reflect.ReflectUtils; import org.onemind.commons.java.util.*; import org.onemind.jxp.parser.*; import org.onemind.jxp.util.StaticImport; import org.onemind.jxp.util.StaticImportUtils; /** * The jxp processor * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class JxpProcessor implements JxpParserVisitor { /** the logger * */ private static final Logger _logger = Logger.getLogger(JxpProcessor.class.getName()); /** represent ONE * */ private static final Integer ONE = new Integer(1); /** contains zero values for primitive **/ private static final Map PRIMITIVE_DEFAULTS = new HashMap(); static { PRIMITIVE_DEFAULTS.put(Integer.TYPE, new Integer(0)); PRIMITIVE_DEFAULTS.put(Long.TYPE, new Long(0)); PRIMITIVE_DEFAULTS.put(Float.TYPE, new Float(0)); PRIMITIVE_DEFAULTS.put(Double.TYPE, new Double(0)); PRIMITIVE_DEFAULTS.put(Character.TYPE, new Character((char) 0)); PRIMITIVE_DEFAULTS.put(Byte.TYPE, new Byte((byte) 0)); PRIMITIVE_DEFAULTS.put(Boolean.TYPE, Boolean.FALSE); } /** * process a file * @param args the arguments * @throws Exception if exception */ public static void main(String[] args) throws Exception { if (args.length != 2) { System.out.println("Usage: java org.onemind.jxp.JxpProcessor "); } else { FilePageSource source = new FilePageSource(args[0]); JxpContext context = new JxpContext(source); JxpProcessor processor = new JxpProcessor(context); Writer writer = new OutputStreamWriter(System.out); try { processor.process(args[1], writer, Collections.EMPTY_MAP); } catch (Exception e) { e.printStackTrace(); } writer.flush(); } } /** * Represents a user defined function * @author TiongHiang Lee (thlee@onemindsoft.org) * */ private class JxpUserDefinedFunction { /** the declarator **/ private SimpleNode _paramSpec; /** the block **/ private AstBlock _block; /** * Constructor * @param dec the declarator * @param block the function block */ public JxpUserDefinedFunction(SimpleNode paramSpec, AstBlock block) { _paramSpec = paramSpec; _block = block; } /** * Get the declarator * @return the declarator */ public SimpleNode getParameterSpec() { return _paramSpec; } /** * Get the block * @return the block */ public AstBlock getBlock() { return _block; } } /** a context local keep tracks of current processing context * */ private ThreadLocalStack _contextLocal = new ThreadLocalStack(); /** the jxp page source * */ private JxpContext _context; /** whether do method status **/ //TODO: add as config options private boolean doMethodStats; /** whether to check function argument type **/ private boolean _checkFunctionArgumentType = false; /** the method statistic counter **/ private final Counter _methodStats = new Counter(); /** * Constructor * @param source the page source */ public JxpProcessor(JxpContext context) { _context = context; } /** * Get the source * @return the source */ public final JxpContext getContext() { return _context; } /** * Assign the value assignable target node to the value * @param node the assignable target * @param value the value to assign * @return the value assinged * @throws ProcessingException if the node is not an assignable */ protected Object assign(SimpleNode node, Object value) throws ProcessingException { Object target = resolveAssignmentTarget(node, true); if (target instanceof Assignable) { return ((Assignable) target).assign(value); } else { return generateProcessingException(new IllegalArgumentException(node + " is not assignable"), node); } } /** * Assign a variable in a current nametable stack to the value * @param name the variable name * @param value the value * @return the value assigned */ protected Object assignVariable(String name, Object value) { NametableStack ntStack = getCurrentContext().getNametableStack(); ntStack.assign(name, value); return value; } /** * Call the function of the processor. Call predefined print or println if the method name matched. Otherwise, reflection will * be used on the processor to invoke method * @param methodName the method name * @param args the arguments * @return the value returned by the method call * @throws Exception if there's problem calling method */ protected Object callFunction(String methodName, Object[] args) throws Exception { //built-in functions if (methodName.equals("print")) { print(args[0]); return null; } else if (methodName.equals("println")) { println(args[0]); return null; } else if (methodName.equals("getJxpEnvironment")){ return getEnvironment(); } else { JxpProcessingContext context = getCurrentContext(); String functionName = methodName; if (context.getUserDefinedFunctions().containsKey(functionName)) { JxpUserDefinedFunction function = (JxpUserDefinedFunction) context.getUserDefinedFunctions().get(functionName); NametableStack nt = context.getNametableStack(); int scope = nt.newLocalScope(); declareFunctionLocals(functionName, function.getParameterSpec(), args); try { Object obj = function.getBlock().jjtAccept(this, null); if (obj == Control.EXIT) { return obj; } else if (obj instanceof Control) //return value { return ((Control) obj).getObject(); } else { return obj; } } finally { nt.closeLocalScope(scope); } } else { //try static import List staticImports = context.getStaticImports(); Iterator it = staticImports.iterator(); while (it.hasNext()) { StaticImport sImport = (StaticImport) it.next(); InvocableFunction func = sImport.getFunction(functionName, args); if (func != null) { return func.invoke(null, args); } } //lastly, throw exception throw new NoSuchMethodException("Method " + methodName + " not found for the Processor"); } } } /** * Create the function environment * @param params the parameters * @param args the arguments */ public void declareFunctionLocals(String functionName, SimpleNode params, Object[] args) throws Exception { NametableStack ntStack = getCurrentContext().getNametableStack(); int n = params.jjtGetNumChildren(); Map defaults = new HashMap(); for (int i = 0; i < args.length; i++) { if (args[i] instanceof AstNamedArgument) { SimpleNode arg = (SimpleNode) args[i]; Object value = arg.jjtGetChild(0).jjtAccept(this, null); defaults.put(arg.getData(), value); } } if (params instanceof AstFormalParameters) { for (int i = 0; i < n; i++) { AstFormalParameter param = (AstFormalParameter) params.jjtGetChild(i); AstVariableDeclaratorId id = (AstVariableDeclaratorId) param.jjtGetChild(1); AstType type = (AstType) param.jjtGetChild(0); Class paramType = (Class) type.jjtAccept(this, null); if (param.jjtGetNumChildren() == 2) {//no defaults if (args.length <= i) { throw new IllegalArgumentException("Mismatch number of arguments"); } else if (args[i] instanceof AstNamedArgument) { throw new IllegalArgumentException("Expecting required paramater " + id.getData() + " for function " + functionName); } else { if (_checkFunctionArgumentType) {//do type checking if (paramType.isPrimitive()) { if (args[i] == null) { throw new IllegalArgumentException("Primitive argument " + id.getData() + " cannot be null"); } else if (!ReflectUtils.isPrimitiveInstance(paramType, args[i])) { throw new IllegalArgumentException("Mismatch argument type for " + id.getData() + ". Expecting " + paramType.getName()); } } else if (args[i] != null) { if (!paramType.isInstance(args[i])) { throw new IllegalArgumentException("Mismatch argument type for " + id.getData() + ". Expecting " + paramType.getName()); } } } ntStack.declare((String) id.getData(), args[i]); } } else {//has default if (defaults.containsKey(id.getData())) { Object value = defaults.remove(id.getData()); ntStack.declare((String) id.getData(), value); } else { if (i >= args.length || args[i] instanceof AstNamedArgument) { Object value = param.jjtGetChild(2).jjtAccept(this, null); ntStack.declare((String) id.getData(), value); } else { ntStack.declare((String) id.getData(), args[i]); } } } } if (defaults.size() > 0) { throw new IllegalArgumentException("Unknown default " + defaults + " for function " + functionName); } } else {//assume variable parameters (varargs) ntStack.declare((String) params.getData(), args); } } /** * Throws the exception * @param e the throwable * @param node the node that the exception current * @return will not return since exception will always be thrown */ private ProcessingException generateProcessingException(Throwable e, SimpleNode node) { ProcessingException ex = new ProcessingException(getCurrentContext().getCurrentPage(), e, node); return ex; } /** * Include another page as a part of current page and process it * @param id the id * @return the object * @throws Exception if there's exception */ protected Object includeCall(String id) throws Exception { return process(id, getCurrentContext()); } /** * Instantiate an instance of class type using the arguments * @param type the type to instantiate * @param args the arguments * @return the object instantiated * @throws Exception if there's problem in the instantiation */ protected Object instantiate(Class type, Object[] args) throws Exception { if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Instantiaing " + type + " with " + StringUtils.concat(args, ",")); } return ReflectUtils.newInstance(type, args); } /** * Invoke the method of object obj with given argument * @param obj the object * @param methodName the method name * @param args the arguments * @return the value return by the method invoked * @throws Exception if there's problem invoking the method */ protected Object invokeMethod(Object obj, String methodName, Object[] args) throws Exception { if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Invoking " + obj.getClass() + "." + methodName + "(" + StringUtils.concat(args, ",") + ")"); } if (obj == this) { return callFunction(methodName, args); } else { if (doMethodStats) { _methodStats.count(methodName); } if (obj instanceof JxpInvocable) { JxpInvocable invocable = (JxpInvocable) obj; if (invocable.canInvoke(methodName, args)) { return invocable.invoke(methodName, args); } } //else fall through return ReflectUtils.invoke(obj, methodName, args); } } /** * Look up a variable in current nametable stack * @param variableName the variable name * @return the value of the variable * @throws NoSuchFieldException the the variable cannot be found */ protected Object lookupVariable(String variableName) throws NoSuchFieldException { NametableStack ntStack = getCurrentContext().getNametableStack(); if (!ntStack.containsName(variableName)) { throw new NoSuchFieldException("Variable/Function " + variableName + " is not declared before"); } Object v = ntStack.access(variableName); if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Looking up variable " + variableName + " found " + v); } return v; } /** * print the object by printing o.toString() using writer of current context. If the object is null, "null" will be printed. * @param o the object * @throws IOException if there's problem doing the printing */ protected void print(Object o) throws IOException { if (o == null) { print("null"); } else { print(o.toString()); } } /** * Print the string using writer of current context * @param s the string * @throws IOException if there's io problem TODO: make to flag IOException to avoid call writes again */ protected void print(String s) throws IOException { Writer writer = getCurrentContext().getWriter(); try { writer.write(s); } catch (Exception e) { _logger.throwing(getClass().getName(), "print", e); } } /** * print the object with the line delimiter "\n" * @param o the object * @throws IOException if there's problem doing the printing */ protected void println(Object o) throws IOException { print(o + "\n"); } /** * print the object with the line delimiter "\n" * @param s the string * @throws IOException if there's problem doing the printing */ protected void println(String s) throws IOException { print(s + "\n"); } /** * Process a page with empty environment */ public Object process(String id, Writer writer) throws Exception { return process(id, writer, Collections.EMPTY_MAP); } /** * process the page identified by id with the context given * @param id the id * @param env the environment * @return value return by this page * @throws Exception if there's problem doing the printing */ public Object process(String id, Writer writer, Map env) throws Exception { JxpProcessingContext procContext = _context.createProcessingContext(env, writer); int scope = _contextLocal.pushLocal(procContext); try { return process(id, procContext); } finally { _contextLocal.popLocalUtil(scope); } } /** * Processing a page identified by id in current context * @param id the id * @return the value return by the processing * @throws Exception if there's problem doing the printing */ protected Object process(String id, JxpProcessingContext context) throws Exception { //resolve the actual id String scriptId = id; JxpPage currentPage = context.getCurrentPage(); if (currentPage != null && !id.startsWith("/")) //relative path { String prefix = StringUtils.substringBeforeLast(currentPage.getName(), "/"); if (prefix != null) { scriptId = FileUtils.concatFilePath(prefix, id); } } JxpPage page = _context.getPageSource().getJxpPage(scriptId); try { context.pushPage(page); return visit(page.getJxpDocument(), null); } finally { context.popPage(page); } } /** * Get the current processing context * @return the current processing context */ public JxpProcessingContext getCurrentContext() { return (JxpProcessingContext) _contextLocal.getLocal(); } /** * Process a page identified by id in current context * @param id the id * @return the value return by the page * @throws Exception if there's problem doing the printing */ protected Object processCall(String id) throws Exception { JxpProcessingContext context = getCurrentContext(); int scope = context.getNametableStack().newScope(); try { return process(id, context); } finally { context.getNametableStack().closeScope(scope); } } /** * Resolve the arguments for function or method call * @param node the node * @param context the context * @return object array containing the resolved argument values * @throws Exception if there's problem */ protected Object[] resolveArguments(AstArguments node, JxpProcessingContext context) throws Exception { int n = node.jjtGetNumChildren(); Object[] args = new Object[n]; for (int i = 0; i < n; i++) { args[i] = node.jjtGetChild(i).jjtAccept(this, context); } return args; } /** * Resolve the array dimensions needed * @param node the ArrayDims node * @param context the processing context * @return the int array containing the dimensions info * @throws Exception if there's problem resolving the dimension */ protected int[] resolveArrayDims(AstArrayDims node, JxpProcessingContext context) throws Exception { int[] dims = new int[node.jjtGetNumChildren()]; for (int i = 0; i < node.jjtGetNumChildren(); i++) { Object o = node.jjtGetChild(i).jjtAccept(this, context); if (o instanceof Number) { dims[i] = ((Number) o).intValue(); } else { throw generateProcessingException(new IllegalArgumentException("Array dimension " + o + " is not a number"), node); } } return dims; } /** * Resolve the assignment target. Exception will be thrown if the node is not assignable and throwExcpetion is true. Otherwise * null will be return if the node cannot be resolved to assignment target. * @param node the simple node or the target * @param throwException whether to throw exception * @return the target * @throws ProcessingException if the target cannot be resolved */ protected Assignable resolveAssignmentTarget(SimpleNode node, boolean throwException) throws ProcessingException { if (node instanceof AstName) { AstName name = (AstName) node; List l = (List) name.getData(); JxpProcessingContext context = getCurrentContext(); if (l.size() == 1) { String variableName = (String) l.get(0); // first case if (context.getNametableStack().containsName(variableName)) { return new VariableAssignable((String) l.get(0), context); } else { //second case JxpPage page = context.getCurrentPage(); if (page.hasStaticVariable(variableName)) { return new StaticVariableAssignable((String) l.get(0), page); } throw generateProcessingException(new IllegalArgumentException("Variable " + variableName + " has not been declared."), node); } } else { //TODO: how about assigning to a field? arr if (throwException) { throw generateProcessingException(new IllegalArgumentException(node + " is not assignable"), node); } else { return null; } } } else if (node instanceof AstArrayReference) { try { Object obj = node.jjtGetChild(0).jjtAccept(this, null); if (obj == null) { throw generateProcessingException(new NullPointerException(), (SimpleNode) node.jjtGetChild(0)); } if (!obj.getClass().isArray()) { throw generateProcessingException(new IllegalArgumentException("Argument is not an array"), (SimpleNode) node .jjtGetChild(0)); } Object dimObj = node.jjtGetChild(1).jjtAccept(this, null); int dim = 0; if (dimObj instanceof Number) { dim = ((Number) dimObj).intValue(); } else { throw generateProcessingException(new IllegalArgumentException("Invalid index type " + dimObj.getClass() + " for array"), node); } return new ArrayAssignable(obj, dim); } catch (ProcessingException e) { throw (ProcessingException) e; } catch (Exception e) { throw generateProcessingException(e, node); } } else { //TODO: other kind of assignable such as array etc if (throwException) { throw generateProcessingException(new IllegalArgumentException(node + " is not assignable"), node); } else { return null; } } } /** * Resolve the class. Call the current context for resolving since the imports in context specific * @param className the class name * @return the class */ protected final Class resolveClass(String className) { return getCurrentContext().resolveClass(className); } /** * Resolve the field on and object. Also resolve the array length field * @param obj the object * @param fieldName the field name * @return the field value * @throws Exception if the field cannot be resolved */ protected Object resolveField(Object obj, String fieldName) throws Exception { if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Resolving field " + fieldName + " of " + obj); } if (obj == null) { throw new NoSuchFieldException("Cannot find field " + fieldName + " for null"); } if (fieldName.equals("class")) { if (obj instanceof Class) { return (Class) obj; } else { throw new IllegalStateException(".class cannot be apply to " + obj); } } if (fieldName.equals("length")) { //check if is array if (obj.getClass().isArray()) { return new Integer(Array.getLength(obj)); } //otherwise just pass through } if (obj instanceof JxpInvocable) { JxpInvocable invocable = (JxpInvocable) obj; if (invocable.canInvoke(fieldName, null)) { return invocable.invoke(fieldName, null); } } if (obj instanceof Map) { return ((Map) obj).get(fieldName); } //otherwise just pass through to use reflection Field f = null; if (obj instanceof Class) { f = ((Class) obj).getField(fieldName); } else { f = obj.getClass().getField(fieldName); } return f.get(obj); } /** * Resolve a object given the name in current processing context. It cound be variable, or class * @param l containing series of identifier * @return the object associated with the name * @throws Exception if there's problem resolving the name */ protected Object resolveName(List l) throws Exception { Object current = null; JxpProcessingContext context = getCurrentContext(); NametableStack ntStack = context.getNametableStack(); for (int i = 0; i < l.size(); i++) { String s = (String) l.get(i); if (i == 0) { //first case, variable if (ntStack.containsName(s)) { current = ntStack.access(s); //lookup variable } else {//second case, page static JxpPage page = context.getCurrentPage(); if (page.hasStaticVariable(s)) { current = page.getStaticVariable(s); } else { //third case, resolve class current = resolveClass(s); if (current == null) { throw new NoSuchFieldException("Variable " + s + " has not been declared"); } } } } else { current = resolveField(current, s); } } return current; } /** * Concat the ASTName to a dotted name notation * @param name the ASTName object * @return the dotted name string */ private String toDottedName(AstName name) { return StringUtils.concat((List) name.getData(), "."); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstArguments, java.lang.Object) */ public Object visit(AstArguments node, Object data) throws Exception { throw new IllegalStateException("visit(AstArguments, Object) should not be called"); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstArrayAllocationExpression, java.lang.Object) */ public Object visit(AstArrayAllocationExpression node, Object data) throws Exception { String className = toDottedName((AstName) node.jjtGetChild(0)); Class type = resolveClass(className); if (type == null) { throw generateProcessingException(new ClassNotFoundException("No definition found for " + className), node); } SimpleNode n = (SimpleNode) node.jjtGetChild(1); if (n instanceof AstArrayDims) { int[] dims = resolveArrayDims((AstArrayDims) n, getCurrentContext()); return Array.newInstance(type, dims); } else { //must be ArrayInitializer return n.jjtAccept(this, type); } } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstArrayDims, java.lang.Object) */ public Object visit(AstArrayDims node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("AstArrayDims are not supposed to be called"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstArrayInitializer, java.lang.Object) */ public Object visit(AstArrayInitializer node, Object data) throws Exception { Class type = (data instanceof Class) ? (Class) data : Object.class; int dim = node.jjtGetNumChildren(); List l = new ArrayList(); Class elementType = null; for (int i = 0; i < dim; i++) { Object element = node.jjtGetChild(i).jjtAccept(this, type); //make sure the element type is correct if (element != null) { elementType = element.getClass(); //save for latter if (!elementType.isArray()) {//must be primitive - check it if (!type.isAssignableFrom(element.getClass())) { throw generateProcessingException(new IllegalArgumentException("Illegal element " + element + " in " + type.getName() + " array"), (SimpleNode) node.jjtGetChild(i)); } } } else { if (type.isPrimitive()) { throw generateProcessingException(new IllegalArgumentException("Illegal element " + element + " in " + type.getName() + " array"), (SimpleNode) node.jjtGetChild(i)); } } l.add(element); } if (elementType != null) { Object[] array = (Object[]) Array.newInstance(elementType, l.size()); return l.toArray(array); } else { return l.toArray(); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstArrayReference, java.lang.Object) */ public Object visit(AstArrayReference node, Object data) throws Exception { Object obj = node.jjtGetChild(0).jjtAccept(this, data); if (obj != null && obj.getClass().isArray()) { Object dimObj = node.jjtGetChild(1).jjtAccept(this, data); int dim = 0; if (dimObj instanceof Number) { dim = ((Number) dimObj).intValue(); } else { throw generateProcessingException(new IllegalArgumentException("Invalid index type " + dimObj.getClass() + " for array"), node); } if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Resolving array reference of " + obj + "[" + dim + "]"); } return Array.get(obj, dim); } else { throw generateProcessingException(new IllegalArgumentException("Cannot get array referernce of non-array " + obj), node); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstAssertStatement, java.lang.Object) */ public Object visit(AstAssertStatement node, Object data) throws Exception { for (int i = 0; i < node.jjtGetNumChildren(); i++) { Boolean assertion = Evaluator.toBoolean(node.jjtGetChild(i).jjtAccept(this, data)); if (!assertion.booleanValue()) { throw generateProcessingException(new AssertionError("Assertion error "), (SimpleNode) node.jjtGetChild(i)); } } return Boolean.TRUE; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstAssignExpression, java.lang.Object) */ public Object visit(AstAssignExpression node, Object data) throws Exception { Object value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), value); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstAndAssignExpression, java.lang.Object) */ public Object visit(AstBitwiseAndAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.bitwiseAnd(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstBitAndExpression, java.lang.Object) */ public Object visit(AstBitwiseAndExpression node, Object data) throws Exception { return Evaluator.bitwiseAnd(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstTildeUnaryExpression, java.lang.Object) */ public Object visit(AstBitwiseComplementExpression node, Object data) throws Exception { return Evaluator.bitwiseComplement(node.jjtGetChild(0).jjtAccept(this, data)); } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstBitwiseOrAssignExpression, java.lang.Object) */ public Object visit(AstBitwiseOrAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.bitwiseOr(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstInclusiveOrExpression, java.lang.Object) */ public Object visit(AstBitwiseOrExpression node, Object data) throws Exception { return Evaluator.bitwiseOr(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstBitwiseXOrAssignExpression, java.lang.Object) */ public Object visit(AstBitwiseXOrAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.bitwiseXOr(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstExclusiveOrExpression, java.lang.Object) */ public Object visit(AstBitwiseXOrExpression node, Object data) throws Exception { return Evaluator.bitwiseXOr(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstBlock, java.lang.Object) */ public Object visit(AstBlock node, Object data) throws Exception { JxpProcessingContext context = getCurrentContext(); int scope = context.getNametableStack().newScope(); Object obj = null; SimpleNode childNode = null; int i = 0; try { for (i = 0; i < node.jjtGetNumChildren(); i++) { childNode = (SimpleNode) node.jjtGetChild(i); obj = childNode.jjtAccept(this, data); if (obj instanceof Control) { break; } } } catch (ProcessingException pe) { throw pe; } catch (Exception e) { throw generateProcessingException(e, childNode); } finally { context.getNametableStack().closeScope(scope); } return obj; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstBreakStatement, java.lang.Object) */ public Object visit(AstBreakStatement node, Object data) throws Exception { return Control.BREAK; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstCase, java.lang.Object) */ public Object visit(AstCase node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("Switch case: are not suppossed to be called"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstCastExpression, java.lang.Object) */ public Object visit(AstCastExpression node, Object data) throws Exception { return node.jjtGetChild( 1 ).jjtAccept( this, data ); } /** * {@inheritDoc} */ public Object visit(AstCatchBlock node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("This should not be called"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstConditionalAndExpression, java.lang.Object) */ public Object visit(AstConditionalAndExpression node, Object data) throws Exception { Boolean b1 = Evaluator.toBoolean(node.jjtGetChild(0).jjtAccept(this, data)); if (!b1.booleanValue()) { return Boolean.FALSE; } Boolean b2 = Evaluator.toBoolean(node.jjtGetChild(1).jjtAccept(this, data)); if (!b2.booleanValue()) { return Boolean.FALSE; } else { return Boolean.TRUE; } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstConditionalOrExpression, java.lang.Object) */ public Object visit(AstConditionalOrExpression node, Object data) throws Exception { Boolean b1 = Evaluator.toBoolean(node.jjtGetChild(0).jjtAccept(this, data)); if (b1.booleanValue()) { return Boolean.TRUE; } Boolean b2 = Evaluator.toBoolean(node.jjtGetChild(1).jjtAccept(this, data)); if (b2.booleanValue()) { return Boolean.TRUE; } else { return Boolean.FALSE; } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstContent, java.lang.Object) */ public Object visit(AstContent node, Object data) throws Exception { Object content = node.getData(); print(content); return content; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstContinueStatement, java.lang.Object) */ public Object visit(AstContinueStatement node, Object data) throws Exception { return Control.CONTINUE; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstSlashAssignExpression, java.lang.Object) */ public Object visit(AstDivideAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.divide(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstSlashExpression, java.lang.Object) */ public Object visit(AstDivideExpression node, Object data) throws Exception { return Evaluator.divide(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstDoStatement, java.lang.Object) */ public Object visit(AstDoStatement node, Object data) throws Exception { Node condition = node.jjtGetChild(1); Boolean b = null; Object returnValue = null; do { returnValue = node.jjtGetChild(0).jjtAccept(this, data); if (returnValue instanceof Control) { if (returnValue == Control.CONTINUE) { returnValue = null; } else if (returnValue == Control.BREAK) { returnValue = null; break; } else { //must be return w/wo object break; } } b = Evaluator.toBoolean(condition.jjtAccept(this, data)); } while (b.booleanValue()); return returnValue; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstEmptyStatement, java.lang.Object) */ public Object visit(AstEmptyStatement node, Object data) throws Exception { return null; } /** * @see org.onemind.jxp.parser.JxpParserVisitor#visit(jxp.parser.AstEQExpression, java.lang.Object) */ public Object visit(AstEQExpression node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data), o2 = node.jjtGetChild(1).jjtAccept(this, data); return Evaluator.eq(o1, o2); } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstField, java.lang.Object) */ public Object visit(AstField node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("visit(AstField, Object) is not supposed to be called"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstFieldDeclaration, java.lang.Object) */ public Object visit(AstFieldDeclaration node, Object data) throws Exception { Boolean isStatic = (node.getData() == null) ? Boolean.FALSE : Boolean.TRUE; Object[] passOn = new Object[]{node.jjtGetChild(0), isStatic}; //ignore the type for (int i = 1; i < node.jjtGetNumChildren(); i++) { node.jjtGetChild(i).jjtAccept(this, passOn); } return null; } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstFieldReference, java.lang.Object) */ public Object visit(AstFieldReference node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data); String fieldName = (String) ((SimpleNode) node.jjtGetChild(1)).getData(); return resolveField(o1, fieldName); } /** * {@inheritDoc} */ public Object visit(AstFinallyBlock node, Object data) throws Exception { return node.jjtGetChild(0).jjtAccept(this, data); //pass on } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstForInit, java.lang.Object) */ public Object visit(AstForInit node, Object data) throws Exception { return node.childrenAccept(this, data); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstFormalParameter, java.lang.Object) */ public Object visit(AstFormalParameter node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException( "visit(AstFormalParameter, Object) are not supposed to be called"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstFormalParameters, java.lang.Object) */ public Object visit(AstFormalParameters node, Object data) throws Exception { throw generateProcessingException(new UnsupportedOperationException("Unsupported Language Feature"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstForStatement, java.lang.Object) */ public Object visit(AstForStatement node, Object data) throws Exception { JxpProcessingContext context = getCurrentContext(); SimpleNode forInit = null, forCondition = null, forUpdate = null, statements = null; for (int i = 0; i < node.jjtGetNumChildren() - 1; i++) { SimpleNode n = (SimpleNode) node.jjtGetChild(i); if (n instanceof AstForInit) { forInit = n; } else if (n instanceof AstForUpdate) { forUpdate = n; } else { forCondition = n; } } statements = (SimpleNode) node.jjtGetChild(node.jjtGetNumChildren() - 1); int newscope = context.getNametableStack().newScope(); //this must be in front of for init if (forInit != null) { forInit.jjtAccept(this, data); } Boolean condition = Boolean.TRUE; if (forCondition != null) { condition = Evaluator.toBoolean(forCondition.jjtAccept(this, data)); } Object returnValue = null; try { while (condition.booleanValue()) { returnValue = statements.jjtAccept(this, data); if (returnValue == Control.CONTINUE) { returnValue = null; //let it pass } else if (returnValue == Control.BREAK) { returnValue = null; break; } else if (returnValue instanceof Control) { //must be return w/wo object break; } if (forUpdate != null) { forUpdate.jjtAccept(this, data); } if (forCondition != null) { condition = Evaluator.toBoolean(forCondition.jjtAccept(this, data)); } } } finally { context.getNametableStack().closeScope(newscope); } return returnValue; } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstForUpdate, java.lang.Object) */ public Object visit(AstForUpdate node, Object data) throws Exception { return node.childrenAccept(this, data); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstGEExpression, java.lang.Object) */ public Object visit(AstGEExpression node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data), o2 = node.jjtGetChild(1).jjtAccept(this, data); return Evaluator.ge(o1, o2); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstGTExpression, java.lang.Object) */ public Object visit(AstGTExpression node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data), o2 = node.jjtGetChild(1).jjtAccept(this, data); return Evaluator.gt(o1, o2); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstHookExpression, java.lang.Object) */ public Object visit(AstHookExpression node, Object data) throws Exception { Object returnValue = node.jjtGetChild(0).jjtAccept(this, data); if (returnValue instanceof Boolean) { if (Boolean.TRUE.equals(returnValue)) { return node.jjtGetChild(1).jjtAccept(this, data); } else { return node.jjtGetChild(2).jjtAccept(this, data); } } else { throw generateProcessingException(new IllegalArgumentException( "condition of hook expression is not a boolean expression"), node); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstIfStatement, java.lang.Object) */ public Object visit(AstIfStatement node, Object data) throws Exception { Boolean condition = Evaluator.toBoolean(node.jjtGetChild(0).jjtAccept(this, data)); if (condition.booleanValue()) { return node.jjtGetChild(1).jjtAccept(this, data); } else { if (node.jjtGetNumChildren() > 2) { return node.jjtGetChild(2).jjtAccept(this, data); } else { return null; } } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstImportDeclaration, java.lang.Object) */ public Object visit(AstImportDeclaration node, Object data) throws Exception { JxpProcessingContext context = getCurrentContext(); String packageName = toDottedName((AstName) node.jjtGetChild(0)); String className = (String) node.getData(); String importName = packageName + "." + className; context.getImports().addImport(importName); if (_logger.isLoggable(Level.FINEST)) { _logger.finest("Add import " + importName); _logger.finest(context.getImports().getPackages().toString()); } return null; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstInstanceOfExpression, java.lang.Object) */ public Object visit(AstInstanceOfExpression node, Object data) throws Exception { Object obj = node.jjtGetChild(0).jjtAccept(this, data); //the object if (obj == null) { return Boolean.FALSE; //always false } else { Class c = (Class) node.jjtGetChild(1).jjtAccept(this, data); return Boolean.valueOf(c.isInstance(obj)); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstJxpDocument, java.lang.Object) */ public Object visit(AstJxpDocument node, Object data) throws Exception { int i = 0; int n = node.jjtGetNumChildren(); Object returnValue = null; SimpleNode statement = null; try { while (i < n) { statement = (SimpleNode) node.jjtGetChild(i); returnValue = statement.jjtAccept(this, data); if (returnValue instanceof Control) { return returnValue; } i++; } } catch (ProcessingException pe) { throw pe; } catch (Exception e) { throw generateProcessingException(e, statement); } return null; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstLabeledStatement, java.lang.Object) */ public Object visit(AstLabeledStatement node, Object data) throws Exception { throw generateProcessingException(new UnsupportedOperationException("Labeled statement: Unsupported Language Feature"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstLEExpression, java.lang.Object) */ public Object visit(AstLEExpression node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data), o2 = node.jjtGetChild(1).jjtAccept(this, data); return Evaluator.le(o1, o2); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstLiteral, java.lang.Object) */ public Object visit(AstLiteral node, Object data) throws Exception { return node.getData(); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstBangUnaryExpression, java.lang.Object) */ public Object visit(AstLogicalComplementExpression node, Object data) throws Exception { Boolean b = Evaluator.toBoolean(node.jjtGetChild(0).jjtAccept(this, data)); return Boolean.valueOf(!b.booleanValue()); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstLShiftAssignExpression, java.lang.Object) */ public Object visit(AstLShiftAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.leftShift(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstLShiftExpression, java.lang.Object) */ public Object visit(AstLShiftExpression node, Object data) throws Exception { return Evaluator.leftShift(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstLTExpression, java.lang.Object) */ public Object visit(AstLTExpression node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data), o2 = node.jjtGetChild(1).jjtAccept(this, data); return Evaluator.lt(o1, o2); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstMethodCall, java.lang.Object) */ public Object visit(AstMethodCall node, Object data) throws Exception { String methodName = (String) node.getData(); Object[] args = resolveArguments((AstArguments) node.jjtGetChild(0), getCurrentContext()); if (args.length == 0) { if (methodName.equals("flush")) { flush(); return null; } } else if (args[0] instanceof String && args.length == 1) { /* if (methodName.equals("process")) { return processCall((String) args[0]); } else */ if (methodName.equals("include")) { return includeCall((String) args[0]); } } try { return invokeMethod(this, methodName, args); } catch (ProcessingException e) { throw e; } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); throw generateProcessingException(t, node); } catch (Exception e) { throw generateProcessingException(e, node); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstMethodDeclaration, java.lang.Object) */ public Object visit(AstFunctionDeclaration node, Object data) throws Exception { int i = 0; SimpleNode declarator = null; do { declarator = (SimpleNode) node.jjtGetChild(i++); } while (!(declarator instanceof AstFunctionDeclarator)); //child is FunctionDeclarator now SimpleNode block = null; int n = node.jjtGetNumChildren(); if (i < n) { do { block = (SimpleNode) node.jjtGetChild(i++); } while (!(block instanceof AstBlock) && i < n); } return getCurrentContext().getUserDefinedFunctions().put((String) declarator.getData(), new JxpUserDefinedFunction((SimpleNode) declarator.jjtGetChild(0), (AstBlock) block)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstMethodDeclarator, java.lang.Object) */ public Object visit(AstFunctionDeclarator node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException( "visit(AstFunctionDeclarator,Object) is not meant to be called."), node); } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstMethodInvocation, java.lang.Object) */ public Object visit(AstMethodInvocation node, Object data) throws Exception { // the prefix node Object obj = node.jjtGetChild(0).jjtAccept(this, data); SimpleNode methodCall = (SimpleNode) node.jjtGetChild(1); String methodName = (String) methodCall.getData(); if (obj == null) { throw generateProcessingException(new NullPointerException("Cannot invoke method " + methodName + "(...) of null at "), node); } Object[] args = resolveArguments((AstArguments) methodCall.jjtGetChild(0), getCurrentContext()); try { return invokeMethod(obj, methodName, args); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); throw generateProcessingException(t, node); } catch (Exception e) { throw generateProcessingException(e, node); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstMinusAssignExpression, java.lang.Object) */ public Object visit(AstMinusAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.minus(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstMinusExpression, java.lang.Object) */ public Object visit(AstMinusExpression node, Object data) throws Exception { return Evaluator.minus(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstStarAssignExpression, java.lang.Object) */ public Object visit(AstMultiplyAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.multiply(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstMultiplyExpression, java.lang.Object) */ public Object visit(AstMultiplyExpression node, Object data) throws Exception { return Evaluator.multiply(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstName, java.lang.Object) */ public Object visit(AstName node, Object data) throws Exception { List l = (List) node.getData(); try { return resolveName(l); } catch (Exception e) { throw generateProcessingException(e, node); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstNameList, java.lang.Object) */ public Object visit(AstNameList node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("visit(ASTNameList, Object) not supposed to be called"), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstNEExpression, java.lang.Object) */ public Object visit(AstNEExpression node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data), o2 = node.jjtGetChild(1).jjtAccept(this, data); return Evaluator.ne(o1, o2); } /** * (non-Javadoc) * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstObjectAllocationExpression, java.lang.Object) */ public Object visit(AstObjectAllocationExpression node, Object data) throws Exception { String className = toDottedName((AstName) node.jjtGetChild(0)); Class type = getCurrentContext().resolveClass(className); if (type == null) { throw generateProcessingException(new ClassNotFoundException("No definition found for " + className), node); } Object[] args = resolveArguments((AstArguments) node.jjtGetChild(1), getCurrentContext()); try { return instantiate(type, args); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); throw generateProcessingException(t, node); } catch (Exception e) { throw generateProcessingException(e, node); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPlusAssignExpression, java.lang.Object) */ public Object visit(AstPlusAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.plus(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPlusExpression, java.lang.Object) */ public Object visit(AstPlusExpression node, Object data) throws Exception { Object o1 = node.jjtGetChild(0).jjtAccept(this, data), o2 = node.jjtGetChild(1).jjtAccept(this, data); return Evaluator.plus(o1, o2); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPostfixDecrementExpression, java.lang.Object) */ public Object visit(AstPostDecrementExpression node, Object data) throws Exception { Object returnValue = node.jjtGetChild(0).jjtAccept(this, data); Object newValue = Evaluator.minus(returnValue, ONE); if (resolveAssignmentTarget((SimpleNode) node.jjtGetChild(0), false) != null) { assign((SimpleNode) node.jjtGetChild(0), newValue); } return returnValue; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPostfixIncrementExpression, java.lang.Object) */ public Object visit(AstPostIncrementExpression node, Object data) throws Exception { Object returnValue = node.jjtGetChild(0).jjtAccept(this, data); Object newValue = Evaluator.plus(returnValue, ONE); if (resolveAssignmentTarget((SimpleNode) node.jjtGetChild(0), false) != null) { assign((SimpleNode) node.jjtGetChild(0), newValue); } return returnValue; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPreDecrementExpression, java.lang.Object) */ public Object visit(AstPreDecrementExpression node, Object data) throws Exception { Object returnValue = node.jjtGetChild(0).jjtAccept(this, data); Object newValue = Evaluator.minus(returnValue, ONE); //TODO: improve performance if (resolveAssignmentTarget((SimpleNode) node.jjtGetChild(0), false) != null) { assign((SimpleNode) node.jjtGetChild(0), newValue); } return newValue; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPreIncrementExpression, java.lang.Object) */ public Object visit(AstPreIncrementExpression node, Object data) throws Exception { Object returnValue = node.jjtGetChild(0).jjtAccept(this, data); Object newValue = Evaluator.plus(returnValue, ONE); //TODO: improve performance if (resolveAssignmentTarget((SimpleNode) node.jjtGetChild(0), false) != null) { assign((SimpleNode) node.jjtGetChild(0), newValue); } return newValue; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPrimaryExpression, java.lang.Object) */ public Object visit(AstPrimaryExpression node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException( "visit(AstPrimaryExpression, Object) not supposed to be called."), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPrimarySuffix, java.lang.Object) */ public Object visit(AstPrimarySuffix node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("visit(AstPrimarySuffix, Object) not supposed to be called."), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPrimitiveType, java.lang.Object) */ public Object visit(AstPrimitiveType node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("visit(AstPrimitiveType, Object) not supposed to be called."), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstPrintStatement, java.lang.Object) */ public Object visit(AstPrintStatement node, Object data) throws Exception { print(node.jjtGetChild(0).jjtAccept(this, data)); return null; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstRemainderExpression, java.lang.Object) */ public Object visit(AstRemainderExpression node, Object data) throws Exception { return Evaluator.remainder(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstRemAssignExpression, java.lang.Object) */ public Object visit(AstRemAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.remainder(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstReturnStatement, java.lang.Object) */ public Object visit(AstReturnStatement node, Object data) throws Exception { if (node.jjtGetNumChildren() > 0) { return new Control(node.jjtGetChild(0).jjtAccept(this, data)); } else { return Control.RETURN; } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstRSignedShiftAssignExpression, java.lang.Object) */ public Object visit(AstRSignedShiftAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.rightSignedShift(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstRSignedShiftExpression, java.lang.Object) */ public Object visit(AstRSignedShiftExpression node, Object data) throws Exception { return Evaluator.rightUnsignedShift(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstRUnsignedShiftAssignExpression, java.lang.Object) */ public Object visit(AstRUnsignedShiftAssignExpression node, Object data) throws Exception { Object origValue = node.jjtGetChild(0).jjtAccept(this, data), value = node.jjtGetChild(1).jjtAccept(this, data); return assign((SimpleNode) node.jjtGetChild(0), Evaluator.rightUnsignedShift(origValue, value)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstRUnsignedShiftExpression, java.lang.Object) */ public Object visit(AstRUnsignedShiftExpression node, Object data) throws Exception { return Evaluator.rightUnsignedShift(node.jjtGetChild(0).jjtAccept(this, data), node.jjtGetChild(1).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstStatementExpressionList, java.lang.Object) */ public Object visit(AstStatementExpressionList node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException( "visit(AstStatementExpressionList, Object) not supposed to be called."), node); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstSwitchStatement, java.lang.Object) */ public Object visit(AstSwitchStatement node, Object data) throws Exception { Object switchValue = node.jjtGetChild(0).jjtAccept(this, data); //resolve the value first if (switchValue == null) { throw generateProcessingException(new IllegalArgumentException("Switch value cannot be null"), node); } int n = node.jjtGetNumChildren(); boolean matchCase = false; for (int i = 1; i < n; i++) { AstCase case_ = (AstCase) node.jjtGetChild(i); int caseChildren = case_.jjtGetNumChildren(); if (!matchCase) //haven't match before {//try to match the case if (caseChildren == 1) {//must be the default: calse matchCase = true; } else { Object caseValue = case_.jjtGetChild(0).jjtAccept(this, null); if (caseValue == null) { throw generateProcessingException(new IllegalArgumentException("Switch case value cannot be null"), case_); } if (switchValue.equals(caseValue)) { matchCase = true; } } } if (matchCase) { Object obj = case_.jjtGetChild(caseChildren - 1).jjtAccept(this, null); if (obj == Control.BREAK) { return null; } else if (obj instanceof Control) {//either return or exit return obj; } //else just continue to fall through } } return null; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstSynchronizedStatement, java.lang.Object) */ public Object visit(AstSynchronizedStatement node, Object data) throws Exception { Object obj = node.jjtGetChild(0).jjtAccept(this, data); if (obj == null) { throw generateProcessingException(new IllegalArgumentException("Cannot synchronize on null"), node); } else { synchronized (obj) { return node.jjtGetChild(1).jjtAccept(this, data); } } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstThrowStatement, java.lang.Object) */ public Object visit(AstThrowStatement node, Object data) throws Exception { Object o = node.jjtGetChild(0).jjtAccept(this, data); if (o instanceof Exception) { throw (Exception) o; } else { throw generateProcessingException(new IllegalArgumentException("Cannot throw non-exception " + o), node); } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstTryStatement, java.lang.Object) */ public Object visit(AstTryStatement node, Object data) throws Exception { int n = node.jjtGetNumChildren(); int i = 0; try { SimpleNode block = (SimpleNode) node.jjtGetChild(0); return block.jjtAccept(this, data); } catch (Throwable e) { JxpProcessingContext context = getCurrentContext(); Throwable realCause = e; if (realCause instanceof ProcessingException && realCause.getCause() != null) { realCause = realCause.getCause(); } for (i = 1; i < n; i++) { SimpleNode handlerBlock = (SimpleNode) node.jjtGetChild(i); if (handlerBlock instanceof AstCatchBlock) { //catchblock //SimpleNode formalParameter = (SimpleNode) handlerBlock.jjtGetChild(0); AstType type = (AstType) handlerBlock.jjtGetChild(0); Class c = (Class) type.jjtAccept(this, data); if (c.isAssignableFrom(realCause.getClass())) { int scope = context.getNametableStack().newScope(); try { AstVariableDeclaratorId id = (AstVariableDeclaratorId) handlerBlock.jjtGetChild(1); context.getNametableStack().declare((String) id.getData(), realCause); return handlerBlock.jjtGetChild(2).jjtAccept(this, data); //execute the catch block } catch (Exception eAgain) { //again throw generateProcessingException(eAgain, (SimpleNode) handlerBlock.jjtGetChild(1)); } finally { context.getNametableStack().closeScope(scope); } } } } //exception has no handler if (e instanceof ProcessingException) { throw (ProcessingException) e; //rethrown - should be because of block } else { throw new IllegalStateException("Should be ProcessingException after try block"); } } finally { if (i < n) { //still something un SimpleNode block = (SimpleNode) node.jjtGetChild(n - 1); if (block instanceof AstFinallyBlock) { block.jjtAccept(this, data); } } } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstUnaryMinusExpression, java.lang.Object) */ public Object visit(AstUnaryMinusExpression node, Object data) throws Exception { return Evaluator.negate(node.jjtGetChild(0).jjtAccept(this, data)); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstUnaryPlusExpression, java.lang.Object) */ public Object visit(AstUnaryPlusExpression node, Object data) throws Exception { return node.jjtGetChild(0).jjtAccept(this, data); } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstVariableDeclarator, java.lang.Object) */ public Object visit(AstVariableDeclarator node, Object data) throws Exception { Object[] passOn = (Object[]) data; Object value = null; if (node.jjtGetNumChildren() > 1) { //has initializer value = node.jjtGetChild(1).jjtAccept(this, null); } else { AstType type = (AstType) passOn[0]; if (type.jjtGetChild(0) instanceof AstPrimitiveType) { AstPrimitiveType primitive = (AstPrimitiveType) type.jjtGetChild(0); value = PRIMITIVE_DEFAULTS.get(primitive.getData()); } } String variableName = (String) ((AstVariableDeclaratorId) node.jjtGetChild(0)).getData(); if (((Boolean) passOn[1]).booleanValue()) {//static variable flag, pass from visit(AstFieldDeclaration) JxpPage page = getCurrentContext().getCurrentPage(); if (!page.hasStaticVariable(variableName)) { page.declareStaticVariable(variableName, value); } return value; } else { getCurrentContext().getNametableStack().declare(variableName, value); return value; } } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.AstWhileStatement, java.lang.Object) */ public Object visit(AstWhileStatement node, Object data) throws Exception { Node condition = node.jjtGetChild(0); Boolean b = Evaluator.toBoolean(condition.jjtAccept(this, data)); Object returnValue = null; while (b.booleanValue()) { returnValue = node.jjtGetChild(1).jjtAccept(this, data); if (returnValue instanceof Control) { if (returnValue == Control.CONTINUE) { returnValue = null; //clear up } else if (returnValue == Control.BREAK) { returnValue = null; //clear up break; } else { //must be return w/wo object break; } } b = Evaluator.toBoolean(condition.jjtAccept(this, data)); } return returnValue; } /** * @see jxp.parser.JxpParserVisitor#visit(jxp.parser.SimpleNode, java.lang.Object) */ public Object visit(SimpleNode node, Object data) throws Exception { throw new IllegalStateException("Illegal state"); } /** * Flush the writer * @throws IOException if there's io exception */ public void flush() throws IOException { getCurrentContext().getWriter().flush(); } /** * {@inheritDoc} * @todo support array type * TODO support array type */ public Object visit(AstType node, Object data) throws Exception { Node child = node.jjtGetChild(0); Class c = null; if (child instanceof AstName) { AstName name = (AstName) child; String className = toDottedName(name); c = getCurrentContext().resolveClass(className); if (c == null) { throw generateProcessingException(new ClassNotFoundException("Class " + className + " not found"), node); } } else {//primitive type c = (Class) ((AstPrimitiveType)child).getData(); } //TODO: work on the dimension return c; } /** * Get the method stats * @return the method stats */ public Counter getMethodStats() { return _methodStats; } /** * {@inheritDoc} */ public Object visit(AstVariableDeclaratorId node, Object data) throws Exception { // TODO Auto-generated method stub throw generateProcessingException(new IllegalStateException( "visit(AstVariableDeclaratorId,Object) should not be called directly"), node); } /** * {@inheritDoc} */ public Object visit(AstExitStatement node, Object data) throws Exception { return Control.EXIT; } /** * {@inheritDoc} */ public Object visit(AstStaticImportDeclaration node, Object data) throws Exception { JxpProcessingContext context = getCurrentContext(); AstName name = (AstName) node.jjtGetChild(0); String className = toDottedName(name); Class c = context.resolveClass(className); if (c == null) { throw generateProcessingException(new IllegalArgumentException("Cannot resolve class " + className), node); } StaticImport si = StaticImportUtils.getStaticImport(c); context.addStaticImport(si); Iterator it = si.getStaticFields().entrySet().iterator(); NametableStack ntStack = context.getNametableStack(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); ntStack.declare((String) entry.getKey(), entry.getValue()); } return null; } /** * {@inheritDoc} */ public Object visit(AstVariableParameters node, Object data) throws Exception { throw generateProcessingException(new IllegalStateException("visit(AstVariableParameters) should not be called directly"), node); } /** * {@inheritDoc} */ public Object visit(AstEnhancedForStatement node, Object data) throws Exception { JxpProcessingContext context = getCurrentContext(); String variable = (String) node.getData(); Node statements = node.jjtGetChild(2); Object colObj = node.jjtGetChild(1).jjtAccept(this, data); if (colObj instanceof Collection) {//must be Object returnValue = null; Iterator it = ((Collection) colObj).iterator(); int newscope = context.getNametableStack().newScope(); try { context.getNametableStack().declare(variable, null); while (it.hasNext()) { assignVariable(variable, it.next()); returnValue = statements.jjtAccept(this, data); if (returnValue == Control.CONTINUE) { returnValue = null; //let it pass } else if (returnValue == Control.BREAK) { returnValue = null; break; } else if (returnValue instanceof Control) { //must be return w/wo object break; } } return returnValue; } finally { context.getNametableStack().closeScope(newscope); } } else { throw generateProcessingException(new IllegalArgumentException( "Expression for enhanced for loop must be collection, get " + colObj + " instead"), node); } } public void setDoMethodStats(boolean flag) { doMethodStats = flag; } public Object visit(AstNamedArgument node, Object data) throws Exception { return node; //process it later } /** * Get current environment * @return the environment */ public Map getEnvironment() { return getCurrentContext().getNametableStack().asMap(); } /** * Return the checkFunctionArgumentType * @return the checkFunctionArgumentType. */ protected final boolean isCheckFunctionArgumentType() { return _checkFunctionArgumentType; } /** * Set the checkFunctionArgumentType * @param checkFunctionArgumentType The checkFunctionArgumentType to set. */ protected final void setCheckFunctionArgumentType(boolean checkFunctionArgumentType) { _checkFunctionArgumentType = checkFunctionArgumentType; } public Object visit(AstPageDirective node, Object data) throws Exception { Map m = (Map)node.getData(); if (m.containsKey("import")){ String imports = (String)m.get("import"); JxpProcessingContext context = getCurrentContext(); StringTokenizer st = new StringTokenizer(imports, ","); while (st.hasMoreTokens()){ String im = st.nextToken(); context.getImports().addImport(im); } } return null; } public Object visit(AstIncludeDirective node, Object data) throws Exception { return null; } public Object visit(AstIsEmptyExpression node, Object data) throws Exception { Object obj = node.jjtGetChild(0).jjtAccept(this, data); return Boolean.valueOf(StringUtils.isNullOrEmpty(obj)); } }jxp-1.6.1/src/java/org/onemind/jxp/JxpProcessor.java.rej100644 0 0 15726 10530435352 20316 0ustar 0 0 @@ -1318,14 +1339,15 @@ { if (Boolean.TRUE.equals(returnValue)) { - return node.jjtGetChild(1).jjtAccept(this, data); - } else + return node.jjtGetChild(1).jjtAccept(this, data); + } else { return node.jjtGetChild(2).jjtAccept(this, data); } - } else + } else { - throw generateProcessingException(new IllegalArgumentException("condition of hook expression is not a boolean expression"), node); + throw generateProcessingException(new IllegalArgumentException( + "condition of hook expression is not a boolean expression"), node); } } @@ -1541,8 +1563,8 @@ block = (SimpleNode) node.jjtGetChild(i++); } while (!(block instanceof AstBlock) && i < n); } - return getCurrentContext().getFunctions().put((String) declarator.getData(), - new JxpUserDefinedFunction((AstFormalParameters) declarator.jjtGetChild(0), (AstBlock) block)); + return getCurrentContext().getUserDefinedFunctions().put((String) declarator.getData(), + new JxpUserDefinedFunction((SimpleNode) declarator.jjtGetChild(0), (AstBlock) block)); } /** @@ -1870,49 +1892,48 @@ public Object visit(AstSwitchStatement node, Object data) throws Exception { Object switchValue = node.jjtGetChild(0).jjtAccept(this, data); //resolve the value first - if (switchValue==null) + if (switchValue == null) { throw generateProcessingException(new IllegalArgumentException("Switch value cannot be null"), node); } int n = node.jjtGetNumChildren(); boolean matchCase = false; - for (int i=1; i= maxNextCharInd) FillBuff(); return nextCharBuf[nextCharInd]; } 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 += (8 - (column & 07)); break; default : break; } bufline[bufpos] = line; bufcolumn[bufpos] = column; } 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) { if (backSlashCnt > 1) backup(backSlashCnt); 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 * @see #getEndColumn */ public int getColumn() { return bufcolumn[bufpos]; } /** * @deprecated * @see #getEndLine */ public int getLine() { return bufline[bufpos]; } public int getEndColumn() { return bufcolumn[bufpos]; } public int getEndLine() { return bufline[bufpos]; } public int getBeginColumn() { return bufcolumn[tokenBegin]; } public int getBeginLine() { return bufline[tokenBegin]; } public void backup(int amount) { inBuf += amount; if ((bufpos -= amount) < 0) bufpos += bufsize; } 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]; } public JavaCharStream(java.io.Reader dstream, int startline, int startcolumn) { this(dstream, startline, startcolumn, 4096); } public JavaCharStream(java.io.Reader dstream) { this(dstream, 1, 1, 4096); } 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; } public void ReInit(java.io.Reader dstream, int startline, int startcolumn) { ReInit(dstream, startline, startcolumn, 4096); } public void ReInit(java.io.Reader dstream) { ReInit(dstream, 1, 1, 4096); } public JavaCharStream(java.io.InputStream dstream, int startline, int startcolumn, int buffersize) { this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); } public JavaCharStream(java.io.InputStream dstream, int startline, int startcolumn) { this(dstream, startline, startcolumn, 4096); } public JavaCharStream(java.io.InputStream dstream) { this(dstream, 1, 1, 4096); } public void ReInit(java.io.InputStream dstream, int startline, int startcolumn, int buffersize) { ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096); } public void ReInit(java.io.InputStream dstream, int startline, int startcolumn) { ReInit(dstream, startline, startcolumn, 4096); } public void ReInit(java.io.InputStream dstream) { ReInit(dstream, 1, 1, 4096); } 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); } 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; } 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]; } } jxp-1.6.1/src/java/org/onemind/jxp/parser/JJTJxpParserState.java100644 0 0 6147 10530435353 21637 0ustar 0 0 /* Generated By:JJTree: Do not edit this line. JJTJxpParserState.java */ package org.onemind.jxp.parser; class JJTJxpParserState { private java.util.Stack nodes; private java.util.Stack marks; private int sp; // number of nodes on stack private int mk; // current mark private boolean node_created; JJTJxpParserState() { nodes = new java.util.Stack(); marks = new java.util.Stack(); sp = 0; mk = 0; } /* Determines whether the current node was actually closed and pushed. This should only be called in the final user action of a node scope. */ boolean nodeCreated() { return node_created; } /* Call this to reinitialize the node stack. It is called automatically by the parser's ReInit() method. */ void reset() { nodes.removeAllElements(); marks.removeAllElements(); sp = 0; mk = 0; } /* Returns the root node of the AST. It only makes sense to call this after a successful parse. */ Node rootNode() { return (Node)nodes.elementAt(0); } /* Pushes a node on to the stack. */ void pushNode(Node n) { nodes.push(n); ++sp; } /* Returns the node on the top of the stack, and remove it from the stack. */ Node popNode() { if (--sp < mk) { mk = ((Integer)marks.pop()).intValue(); } return (Node)nodes.pop(); } /* Returns the node currently on the top of the stack. */ Node peekNode() { return (Node)nodes.peek(); } /* Returns the number of children on the stack in the current node scope. */ int nodeArity() { return sp - mk; } void clearNodeScope(Node n) { while (sp > mk) { popNode(); } mk = ((Integer)marks.pop()).intValue(); } void openNodeScope(Node n) { marks.push(new Integer(mk)); mk = sp; n.jjtOpen(); } /* A definite node is constructed from a specified number of children. That number of nodes are popped from the stack and made the children of the definite node. Then the definite node is pushed on to the stack. */ void closeNodeScope(Node n, int num) { mk = ((Integer)marks.pop()).intValue(); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; } /* A conditional node is constructed if its condition is true. All the nodes that have been pushed since the node was opened are made children of the the conditional node, which is then pushed on to the stack. If the condition is false the node is not constructed and they are left on the stack. */ void closeNodeScope(Node n, boolean condition) { if (condition) { int a = nodeArity(); mk = ((Integer)marks.pop()).intValue(); while (a-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, a); } n.jjtClose(); pushNode(n); node_created = true; } else { mk = ((Integer)marks.pop()).intValue(); node_created = false; } } } jxp-1.6.1/src/java/org/onemind/jxp/parser/JxpParser.java100644 0 0 743666 10530435353 20344 0ustar 0 0 /* Generated By:JJTree&JavaCC: Do not edit this line. JxpParser.java */ /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.parser; import java.io.*; import java.util.*; import org.onemind.commons.java.lang.*; public class JxpParser/*@bgen(jjtree)*/implements JxpParserTreeConstants, JxpParserConstants {/*@bgen(jjtree)*/ protected JJTJxpParserState jjtree = new JJTJxpParserState();public static void main(String args[]) throws ParseException, IOException { System.out.println("Dumping structure for " + args[0]); JxpParser parser= new JxpParser(new FileInputStream(args[0])); AstJxpDocument doc= parser.JxpDocument(); doc.dump(""); } void jjtreeOpenNodeScope(Node n) { ((SimpleNode) n)._line= getToken(0).beginLine; ((SimpleNode) n)._col= getToken(0).beginColumn; } void jjtreeCloseNodeScope(Node n) {} static String normalizeStringLiteral(StringBuffer image, char quote){ String str = image.substring(1, image.length() - 1); //remove the quotes StringBuffer copy = new StringBuffer(); boolean escape = false; for (int i=0; i | | | | | | | | "strictfp" )? ResultType() "(" } */ final public void FieldDeclaration() throws ParseException { /*@bgen(jjtree) FieldDeclaration */ AstFieldDeclaration jjtn000 = new AstFieldDeclaration(JJTFIELDDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STATIC: jj_consume_token(STATIC); jjtn000._data = token.image; break; default: jj_la1[12] = jj_gen; ; } Type(); VariableDeclarator(); label_4: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[13] = jj_gen; break label_4; } jj_consume_token(COMMA); VariableDeclarator(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void VariableDeclarator() throws ParseException { /*@bgen(jjtree) VariableDeclarator */ AstVariableDeclarator jjtn000 = new AstVariableDeclarator(JJTVARIABLEDECLARATOR); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { VariableDeclaratorId(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); VariableInitializer(); break; default: jj_la1[14] = jj_gen; ; } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void VariableDeclaratorId() throws ParseException { /*@bgen(jjtree) VariableDeclaratorId */ AstVariableDeclaratorId jjtn000 = new AstVariableDeclaratorId(JJTVARIABLEDECLARATORID); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);AstVariableDeclaratorId idNode = (AstVariableDeclaratorId)jjtn000; try { jj_consume_token(IDENTIFIER); jjtn000._data = token.image; label_5: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: jj_la1[15] = jj_gen; break label_5; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); idNode._dim++; } } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void VariableInitializer() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: ArrayInitializer(); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_la1[16] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } final public void ArrayInitializer() throws ParseException { /*@bgen(jjtree) ArrayInitializer */ AstArrayInitializer jjtn000 = new AstArrayInitializer(JJTARRAYINITIALIZER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LBRACE); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LBRACE: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: VariableInitializer(); label_6: while (true) { if (jj_2_5(2)) { ; } else { break label_6; } jj_consume_token(COMMA); VariableInitializer(); } break; default: jj_la1[17] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: jj_consume_token(COMMA); break; default: jj_la1[18] = jj_gen; ; } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void ExitStatement() throws ParseException { /*@bgen(jjtree) ExitStatement */ AstExitStatement jjtn000 = new AstExitStatement(JJTEXITSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(EXIT); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void FunctionDeclaration() throws ParseException { /*@bgen(jjtree) FunctionDeclaration */ AstFunctionDeclaration jjtn000 = new AstFunctionDeclaration(JJTFUNCTIONDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(FUNCTION); ResultType(); FunctionDeclarator(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 172: jj_consume_token(172); NameList(); break; default: jj_la1[19] = jj_gen; ; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACE: Block(); break; case SEMICOLON: jj_consume_token(SEMICOLON); break; default: jj_la1[20] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void FunctionDeclarator() throws ParseException { /*@bgen(jjtree) FunctionDeclarator */ AstFunctionDeclarator jjtn000 = new AstFunctionDeclarator(JJTFUNCTIONDECLARATOR); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(IDENTIFIER); jjtn000._data = token.image; if (jj_2_6(2147483647)) { VariableParameters(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: FormalParameters(); break; default: jj_la1[21] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } label_7: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: jj_la1[22] = jj_gen; break label_7; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void VariableParameters() throws ParseException { /*@bgen(jjtree) VariableParameters */ AstVariableParameters jjtn000 = new AstVariableParameters(JJTVARIABLEPARAMETERS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LPAREN); 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 VAR: case IDENTIFIER: Type(); jj_consume_token(DOTDOTDOT); jj_consume_token(IDENTIFIER); jjtn000._data = token.image; break; default: jj_la1[23] = jj_gen; ; } jj_consume_token(RPAREN); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void FormalParameters() throws ParseException { /*@bgen(jjtree) FormalParameters */ AstFormalParameters jjtn000 = new AstFormalParameters(JJTFORMALPARAMETERS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { 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 VAR: case IDENTIFIER: FormalParameter(); label_8: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[24] = jj_gen; break label_8; } jj_consume_token(COMMA); FormalParameter(); } break; default: jj_la1[25] = jj_gen; ; } jj_consume_token(RPAREN); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void FormalParameter() throws ParseException { /*@bgen(jjtree) FormalParameter */ AstFormalParameter jjtn000 = new AstFormalParameter(JJTFORMALPARAMETER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FINAL: jj_consume_token(FINAL); break; default: jj_la1[26] = jj_gen; ; } Type(); VariableDeclaratorId(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); Expression(); break; default: jj_la1[27] = jj_gen; ; } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } /* * Type, name and expression syntax follows. */ final public void Type() throws ParseException { /*@bgen(jjtree) Type */ AstType jjtn000 = new AstType(JJTTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);AstType typeNode = (AstType)jjtn000; try { 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 VAR: PrimitiveType(); break; case IDENTIFIER: Name(); break; default: jj_la1[28] = jj_gen; jj_consume_token(-1); throw new ParseException(); } label_9: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: jj_la1[29] = jj_gen; break label_9; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); typeNode._dim++; } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void PrimitiveType() throws ParseException { /*@bgen(jjtree) PrimitiveType */ AstPrimitiveType jjtn000 = new AstPrimitiveType(JJTPRIMITIVETYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: jj_consume_token(BOOLEAN); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Boolean.TYPE; break; case CHAR: jj_consume_token(CHAR); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Character.TYPE; break; case BYTE: jj_consume_token(BYTE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Byte.TYPE; break; case SHORT: jj_consume_token(SHORT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Short.TYPE; break; case INT: jj_consume_token(INT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Integer.TYPE; break; case LONG: jj_consume_token(LONG); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Long.TYPE; break; case FLOAT: jj_consume_token(FLOAT); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Float.TYPE; break; case DOUBLE: jj_consume_token(DOUBLE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Double.TYPE; break; case VAR: jj_consume_token(VAR); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Object.class; break; default: jj_la1[30] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void ResultType() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case VOID: jj_consume_token(VOID); break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case SHORT: case VAR: case IDENTIFIER: Type(); break; default: jj_la1[31] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } final public void Name() throws ParseException { /*@bgen(jjtree) Name */ AstName jjtn000 = new AstName(JJTNAME); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000);List l= new ArrayList(); try { jj_consume_token(IDENTIFIER); l.add(token.image); label_10: while (true) { if (jj_2_7(2147483647) && (getToken(3).kind != LPAREN)) { ; } else { break label_10; } jj_consume_token(DOT); jj_consume_token(IDENTIFIER); l.add(token.image); } if (jj_2_8(2147483647)) { jj_consume_token(LT); Type(); jj_consume_token(GT); } else { ; } jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= l; } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void NameList() throws ParseException { /*@bgen(jjtree) NameList */ AstNameList jjtn000 = new AstNameList(JJTNAMELIST); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { Name(); label_11: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 173: ; break; default: jj_la1[32] = jj_gen; break label_11; } jj_consume_token(173); Name(); } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } /* * Expression syntax follows. */ final public void Expression() throws ParseException { ConditionalExpression(); if (jj_2_9(1) && (getToken(1).specialToken == null)) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ASSIGN: jj_consume_token(ASSIGN); AstAssignExpression jjtn001 = new AstAssignExpression(JJTASSIGNEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { Expression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; case STARASSIGN: jj_consume_token(STARASSIGN); AstMultiplyAssignExpression jjtn002 = new AstMultiplyAssignExpression(JJTMULTIPLYASSIGNEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { Expression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); AstDivideAssignExpression jjtn003 = new AstDivideAssignExpression(JJTDIVIDEASSIGNEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { Expression(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } break; case REMASSIGN: jj_consume_token(REMASSIGN); AstRemAssignExpression jjtn004 = new AstRemAssignExpression(JJTREMASSIGNEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); try { Expression(); } catch (Throwable jjte004) { if (jjtc004) { jjtree.clearNodeScope(jjtn004); jjtc004 = false; } else { jjtree.popNode(); } if (jjte004 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte004;} } if (jjte004 instanceof ParseException) { {if (true) throw (ParseException)jjte004;} } {if (true) throw (Error)jjte004;} } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, 2); jjtreeCloseNodeScope(jjtn004); } } break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); AstPlusAssignExpression jjtn005 = new AstPlusAssignExpression(JJTPLUSASSIGNEXPRESSION); boolean jjtc005 = true; jjtree.openNodeScope(jjtn005); jjtreeOpenNodeScope(jjtn005); try { Expression(); } catch (Throwable jjte005) { if (jjtc005) { jjtree.clearNodeScope(jjtn005); jjtc005 = false; } else { jjtree.popNode(); } if (jjte005 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte005;} } if (jjte005 instanceof ParseException) { {if (true) throw (ParseException)jjte005;} } {if (true) throw (Error)jjte005;} } finally { if (jjtc005) { jjtree.closeNodeScope(jjtn005, 2); jjtreeCloseNodeScope(jjtn005); } } break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); AstMinusAssignExpression jjtn006 = new AstMinusAssignExpression(JJTMINUSASSIGNEXPRESSION); boolean jjtc006 = true; jjtree.openNodeScope(jjtn006); jjtreeOpenNodeScope(jjtn006); try { Expression(); } catch (Throwable jjte006) { if (jjtc006) { jjtree.clearNodeScope(jjtn006); jjtc006 = false; } else { jjtree.popNode(); } if (jjte006 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte006;} } if (jjte006 instanceof ParseException) { {if (true) throw (ParseException)jjte006;} } {if (true) throw (Error)jjte006;} } finally { if (jjtc006) { jjtree.closeNodeScope(jjtn006, 2); jjtreeCloseNodeScope(jjtn006); } } break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); AstLShiftAssignExpression jjtn007 = new AstLShiftAssignExpression(JJTLSHIFTASSIGNEXPRESSION); boolean jjtc007 = true; jjtree.openNodeScope(jjtn007); jjtreeOpenNodeScope(jjtn007); try { Expression(); } catch (Throwable jjte007) { if (jjtc007) { jjtree.clearNodeScope(jjtn007); jjtc007 = false; } else { jjtree.popNode(); } if (jjte007 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte007;} } if (jjte007 instanceof ParseException) { {if (true) throw (ParseException)jjte007;} } {if (true) throw (Error)jjte007;} } finally { if (jjtc007) { jjtree.closeNodeScope(jjtn007, 2); jjtreeCloseNodeScope(jjtn007); } } break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); AstRSignedShiftAssignExpression jjtn008 = new AstRSignedShiftAssignExpression(JJTRSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc008 = true; jjtree.openNodeScope(jjtn008); jjtreeOpenNodeScope(jjtn008); try { Expression(); } catch (Throwable jjte008) { if (jjtc008) { jjtree.clearNodeScope(jjtn008); jjtc008 = false; } else { jjtree.popNode(); } if (jjte008 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte008;} } if (jjte008 instanceof ParseException) { {if (true) throw (ParseException)jjte008;} } {if (true) throw (Error)jjte008;} } finally { if (jjtc008) { jjtree.closeNodeScope(jjtn008, 2); jjtreeCloseNodeScope(jjtn008); } } break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); AstRUnsignedShiftAssignExpression jjtn009 = new AstRUnsignedShiftAssignExpression(JJTRUNSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc009 = true; jjtree.openNodeScope(jjtn009); jjtreeOpenNodeScope(jjtn009); try { Expression(); } catch (Throwable jjte009) { if (jjtc009) { jjtree.clearNodeScope(jjtn009); jjtc009 = false; } else { jjtree.popNode(); } if (jjte009 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte009;} } if (jjte009 instanceof ParseException) { {if (true) throw (ParseException)jjte009;} } {if (true) throw (Error)jjte009;} } finally { if (jjtc009) { jjtree.closeNodeScope(jjtn009, 2); jjtreeCloseNodeScope(jjtn009); } } break; case ANDASSIGN: jj_consume_token(ANDASSIGN); AstBitwiseAndAssignExpression jjtn010 = new AstBitwiseAndAssignExpression(JJTBITWISEANDASSIGNEXPRESSION); boolean jjtc010 = true; jjtree.openNodeScope(jjtn010); jjtreeOpenNodeScope(jjtn010); try { Expression(); } catch (Throwable jjte010) { if (jjtc010) { jjtree.clearNodeScope(jjtn010); jjtc010 = false; } else { jjtree.popNode(); } if (jjte010 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte010;} } if (jjte010 instanceof ParseException) { {if (true) throw (ParseException)jjte010;} } {if (true) throw (Error)jjte010;} } finally { if (jjtc010) { jjtree.closeNodeScope(jjtn010, 2); jjtreeCloseNodeScope(jjtn010); } } break; case XORASSIGN: jj_consume_token(XORASSIGN); AstBitwiseXOrAssignExpression jjtn011 = new AstBitwiseXOrAssignExpression(JJTBITWISEXORASSIGNEXPRESSION); boolean jjtc011 = true; jjtree.openNodeScope(jjtn011); jjtreeOpenNodeScope(jjtn011); try { Expression(); } catch (Throwable jjte011) { if (jjtc011) { jjtree.clearNodeScope(jjtn011); jjtc011 = false; } else { jjtree.popNode(); } if (jjte011 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte011;} } if (jjte011 instanceof ParseException) { {if (true) throw (ParseException)jjte011;} } {if (true) throw (Error)jjte011;} } finally { if (jjtc011) { jjtree.closeNodeScope(jjtn011, 2); jjtreeCloseNodeScope(jjtn011); } } break; case ORASSIGN: jj_consume_token(ORASSIGN); AstBitwiseOrAssignExpression jjtn012 = new AstBitwiseOrAssignExpression(JJTBITWISEORASSIGNEXPRESSION); boolean jjtc012 = true; jjtree.openNodeScope(jjtn012); jjtreeOpenNodeScope(jjtn012); try { Expression(); } catch (Throwable jjte012) { if (jjtc012) { jjtree.clearNodeScope(jjtn012); jjtc012 = false; } else { jjtree.popNode(); } if (jjte012 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte012;} } if (jjte012 instanceof ParseException) { {if (true) throw (ParseException)jjte012;} } {if (true) throw (Error)jjte012;} } finally { if (jjtc012) { jjtree.closeNodeScope(jjtn012, 2); jjtreeCloseNodeScope(jjtn012); } } break; default: jj_la1[33] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } else { ; } } final public void ConditionalExpression() throws ParseException { ConditionalOrExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case HOOK: jj_consume_token(HOOK); Expression(); jj_consume_token(COLON); AstHookExpression jjtn001 = new AstHookExpression(JJTHOOKEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { ConditionalExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } } break; default: jj_la1[34] = jj_gen; ; } } final public void ConditionalOrExpression() throws ParseException { ConditionalAndExpression(); label_12: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case JSP_OR: case SC_OR: ; break; default: jj_la1[35] = jj_gen; break label_12; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_OR: jj_consume_token(SC_OR); break; case JSP_OR: jj_consume_token(JSP_OR); break; default: jj_la1[36] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstConditionalOrExpression jjtn001 = new AstConditionalOrExpression(JJTCONDITIONALOREXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { ConditionalAndExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } } final public void ConditionalAndExpression() throws ParseException { BitwiseOrExpression(); label_13: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case JSP_AND: case SC_AND: ; break; default: jj_la1[37] = jj_gen; break label_13; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SC_AND: jj_consume_token(SC_AND); break; case JSP_AND: jj_consume_token(JSP_AND); break; default: jj_la1[38] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstConditionalAndExpression jjtn001 = new AstConditionalAndExpression(JJTCONDITIONALANDEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { BitwiseOrExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } } final public void BitwiseOrExpression() throws ParseException { BitwiseXOrExpression(); label_14: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_OR: ; break; default: jj_la1[39] = jj_gen; break label_14; } jj_consume_token(BIT_OR); AstBitwiseOrExpression jjtn001 = new AstBitwiseOrExpression(JJTBITWISEOREXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { BitwiseXOrExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } } final public void BitwiseXOrExpression() throws ParseException { BitwiseAndExpression(); label_15: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case XOR: ; break; default: jj_la1[40] = jj_gen; break label_15; } jj_consume_token(XOR); AstBitwiseXOrExpression jjtn001 = new AstBitwiseXOrExpression(JJTBITWISEXOREXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { BitwiseAndExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } } final public void BitwiseAndExpression() throws ParseException { EqualityExpression(); label_16: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BIT_AND: ; break; default: jj_la1[41] = jj_gen; break label_16; } jj_consume_token(BIT_AND); AstBitwiseAndExpression jjtn001 = new AstBitwiseAndExpression(JJTBITWISEANDEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { EqualityExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } } final public void EqualityExpression() throws ParseException { InstanceOfExpression(); label_17: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case JSP_EQ: case JSP_NE: case EQ: case NE: ; break; default: jj_la1[42] = jj_gen; break label_17; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case JSP_EQ: case EQ: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case EQ: jj_consume_token(EQ); break; case JSP_EQ: jj_consume_token(JSP_EQ); break; default: jj_la1[43] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstEQExpression jjtn001 = new AstEQExpression(JJTEQEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { InstanceOfExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; case JSP_NE: case NE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NE: jj_consume_token(NE); break; case JSP_NE: jj_consume_token(JSP_NE); break; default: jj_la1[44] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstNEExpression jjtn002 = new AstNEExpression(JJTNEEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { InstanceOfExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } break; default: jj_la1[45] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void InstanceOfExpression() throws ParseException { RelationalExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INSTANCEOF: jj_consume_token(INSTANCEOF); AstInstanceOfExpression jjtn001 = new AstInstanceOfExpression(JJTINSTANCEOFEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { Type(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; default: jj_la1[46] = jj_gen; ; } } final public void RelationalExpression() throws ParseException { ShiftExpression(); label_18: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case JSP_GT: case JSP_LE: case JSP_LT: case JSP_GE: case GT: case LT: case LE: case GE: ; break; default: jj_la1[47] = jj_gen; break label_18; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case JSP_LT: case LT: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LT: jj_consume_token(LT); break; case JSP_LT: jj_consume_token(JSP_LT); break; default: jj_la1[48] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstLTExpression jjtn001 = new AstLTExpression(JJTLTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { ShiftExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; case JSP_GT: case GT: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GT: jj_consume_token(GT); break; case JSP_GT: jj_consume_token(JSP_GT); break; default: jj_la1[49] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstGTExpression jjtn002 = new AstGTExpression(JJTGTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { ShiftExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } break; case JSP_LE: case LE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LE: jj_consume_token(LE); break; case JSP_LE: jj_consume_token(JSP_LE); break; default: jj_la1[50] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstLEExpression jjtn003 = new AstLEExpression(JJTLEEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { ShiftExpression(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } break; case JSP_GE: case GE: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case GE: jj_consume_token(GE); break; case JSP_GE: jj_consume_token(JSP_GE); break; default: jj_la1[51] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstGEExpression jjtn004 = new AstGEExpression(JJTGEEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); try { ShiftExpression(); } catch (Throwable jjte004) { if (jjtc004) { jjtree.clearNodeScope(jjtn004); jjtc004 = false; } else { jjtree.popNode(); } if (jjte004 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte004;} } if (jjte004 instanceof ParseException) { {if (true) throw (ParseException)jjte004;} } {if (true) throw (Error)jjte004;} } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, 2); jjtreeCloseNodeScope(jjtn004); } } break; default: jj_la1[52] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void ShiftExpression() throws ParseException { AdditiveExpression(); label_19: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: case RSIGNEDSHIFT: case RUNSIGNEDSHIFT: ; break; default: jj_la1[53] = jj_gen; break label_19; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LSHIFT: jj_consume_token(LSHIFT); AstLShiftExpression jjtn001 = new AstLShiftExpression(JJTLSHIFTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { AdditiveExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; case RSIGNEDSHIFT: jj_consume_token(RSIGNEDSHIFT); AstRSignedShiftExpression jjtn002 = new AstRSignedShiftExpression(JJTRSIGNEDSHIFTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { AdditiveExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } break; case RUNSIGNEDSHIFT: jj_consume_token(RUNSIGNEDSHIFT); AstRUnsignedShiftExpression jjtn003 = new AstRUnsignedShiftExpression(JJTRUNSIGNEDSHIFTEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { AdditiveExpression(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } break; default: jj_la1[54] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void AdditiveExpression() throws ParseException { MultiplicativeExpression(); label_20: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: case MINUS: ; break; default: jj_la1[55] = jj_gen; break label_20; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: jj_consume_token(PLUS); AstPlusExpression jjtn001 = new AstPlusExpression(JJTPLUSEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { MultiplicativeExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; case MINUS: jj_consume_token(MINUS); AstMinusExpression jjtn002 = new AstMinusExpression(JJTMINUSEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { MultiplicativeExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } break; default: jj_la1[56] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void MultiplicativeExpression() throws ParseException { UnaryExpression(); label_21: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case JSP_DIV: case JSP_MOD: case STAR: case SLASH: case REM: ; break; default: jj_la1[57] = jj_gen; break label_21; } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case STAR: jj_consume_token(STAR); AstMultiplyExpression jjtn001 = new AstMultiplyExpression(JJTMULTIPLYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { UnaryExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } break; case JSP_DIV: case SLASH: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case SLASH: jj_consume_token(SLASH); break; case JSP_DIV: jj_consume_token(JSP_DIV); break; default: jj_la1[58] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstDivideExpression jjtn002 = new AstDivideExpression(JJTDIVIDEEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { UnaryExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } break; case JSP_MOD: case REM: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case REM: jj_consume_token(REM); break; case JSP_MOD: jj_consume_token(JSP_MOD); break; default: jj_la1[59] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstRemainderExpression jjtn003 = new AstRemainderExpression(JJTREMAINDEREXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { UnaryExpression(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } break; default: jj_la1[60] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void UnaryExpression() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case PLUS: jj_consume_token(PLUS); AstUnaryPlusExpression jjtn001 = new AstUnaryPlusExpression(JJTUNARYPLUSEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { UnaryExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } break; case MINUS: jj_consume_token(MINUS); AstUnaryMinusExpression jjtn002 = new AstUnaryMinusExpression(JJTUNARYMINUSEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { UnaryExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, true); jjtreeCloseNodeScope(jjtn002); } } break; case INCR: jj_consume_token(INCR); AstPreIncrementExpression jjtn003 = new AstPreIncrementExpression(JJTPREINCREMENTEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { PrimaryExpression(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, true); jjtreeCloseNodeScope(jjtn003); } } break; case DECR: jj_consume_token(DECR); AstPreDecrementExpression jjtn004 = new AstPreDecrementExpression(JJTPREDECREMENTEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); try { PrimaryExpression(); } catch (Throwable jjte004) { if (jjtc004) { jjtree.clearNodeScope(jjtn004); jjtc004 = false; } else { jjtree.popNode(); } if (jjte004 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte004;} } if (jjte004 instanceof ParseException) { {if (true) throw (ParseException)jjte004;} } {if (true) throw (Error)jjte004;} } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, true); jjtreeCloseNodeScope(jjtn004); } } break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: UnaryExpressionNotPlusMinus(); break; default: jj_la1[61] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } final public void UnaryExpressionNotPlusMinus() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case TILDE: jj_consume_token(TILDE); AstBitwiseComplementExpression jjtn001 = new AstBitwiseComplementExpression(JJTBITWISECOMPLEMENTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { UnaryExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } break; case JSP_NOT: case BANG: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BANG: jj_consume_token(BANG); break; case JSP_NOT: jj_consume_token(JSP_NOT); break; default: jj_la1[62] = jj_gen; jj_consume_token(-1); throw new ParseException(); } AstLogicalComplementExpression jjtn002 = new AstLogicalComplementExpression(JJTLOGICALCOMPLEMENTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { UnaryExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, true); jjtreeCloseNodeScope(jjtn002); } } break; case JSP_EMPTY: jj_consume_token(JSP_EMPTY); AstIsEmptyExpression jjtn003 = new AstIsEmptyExpression(JJTISEMPTYEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { UnaryExpression(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, true); jjtreeCloseNodeScope(jjtn003); } } break; default: jj_la1[63] = jj_gen; if (jj_2_10(2147483647)) { CastExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: PostfixExpression(); break; default: jj_la1[64] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } } // 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_11(2)) { jj_consume_token(LPAREN); PrimitiveType(); } else if (jj_2_12(2147483647)) { jj_consume_token(LPAREN); Name(); jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); Name(); 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 NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: Literal(); break; default: jj_la1[65] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: jj_la1[66] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void PostfixExpression() throws ParseException { PrimaryExpression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INCR: case DECR: switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INCR: AstPostIncrementExpression jjtn001 = new AstPostIncrementExpression(JJTPOSTINCREMENTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jj_consume_token(INCR); } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } break; case DECR: AstPostDecrementExpression jjtn002 = new AstPostDecrementExpression(JJTPOSTDECREMENTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { jj_consume_token(DECR); } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 1); jjtreeCloseNodeScope(jjtn002); } } break; default: jj_la1[67] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: jj_la1[68] = jj_gen; ; } } final public void CastExpression() throws ParseException { /*@bgen(jjtree) CastExpression */ AstCastExpression jjtn000 = new AstCastExpression(JJTCASTEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_13(2147483647)) { jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpression(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LPAREN: jj_consume_token(LPAREN); Type(); jj_consume_token(RPAREN); UnaryExpressionNotPlusMinus(); break; default: jj_la1[69] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void PrimaryExpression() throws ParseException { PrimaryPrefix(); label_22: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: case DOT: ; break; default: jj_la1[70] = jj_gen; break label_22; } if (jj_2_14(2)) { jj_consume_token(DOT); AllocationExpression(); } else if (jj_2_15(2)) { jj_consume_token(LBRACKET); Expression(); AstArrayReference jjtn001 = new AstArrayReference(JJTARRAYREFERENCE); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { jj_consume_token(RBRACKET); } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } } else if (jj_2_16(3)) { jj_consume_token(DOT); AstMethodInvocation jjtn002 = new AstMethodInvocation(JJTMETHODINVOCATION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { MethodCall(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case DOT: AstFieldReference jjtn003 = new AstFieldReference(JJTFIELDREFERENCE); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { Field(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } break; default: jj_la1[71] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } } final public void PrimaryPrefix() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: Literal(); break; case LPAREN: jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); break; case NEW: AllocationExpression(); break; default: jj_la1[72] = jj_gen; if (jj_2_17(2147483647)) { ResultType(); jj_consume_token(DOT); jj_consume_token(CLASS); } else if (jj_2_18(2)) { MethodCall(); } else if (jj_2_19(3)) { Name(); } else { jj_consume_token(-1); throw new ParseException(); } } } final public void MethodCall() throws ParseException { /*@bgen(jjtree) MethodCall */ AstMethodCall jjtn000 = new AstMethodCall(JJTMETHODCALL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(IDENTIFIER); jjtn000._data= token.image; Arguments(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void Field() throws ParseException { /*@bgen(jjtree) Field */ AstField jjtn000 = new AstField(JJTFIELD); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(DOT); jj_consume_token(IDENTIFIER); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= token.image; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void Literal() throws ParseException { /*@bgen(jjtree) Literal */ AstLiteral jjtn000 = new AstLiteral(JJTLITERAL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INTEGER_LITERAL: jj_consume_token(INTEGER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Integer.valueOf(token.image); break; case FLOATING_POINT_LITERAL: jj_consume_token(FLOATING_POINT_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Float.valueOf(token.image); break; case CHARACTER_LITERAL: jj_consume_token(CHARACTER_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= new Character(token.image.charAt(1)); break; case STRING_LITERAL: jj_consume_token(STRING_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); String str = token.image; jjtn000._data = str; break; case JSP_STRING_LITERAL: jj_consume_token(JSP_STRING_LITERAL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); String str2 = token.image; jjtn000._data = str2; break; case TRUE: jj_consume_token(TRUE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Boolean.TRUE; break; case FALSE: jj_consume_token(FALSE); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= Boolean.FALSE; break; case NULL: jj_consume_token(NULL); jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); jjtn000._data= null; break; default: jj_la1[73] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void Arguments() throws ParseException { /*@bgen(jjtree) Arguments */ AstArguments jjtn000 = new AstArguments(JJTARGUMENTS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: if (jj_2_21(2)) { NamedArgument(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Argument(); label_23: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[74] = jj_gen; break label_23; } jj_consume_token(COMMA); if (jj_2_20(2)) { NamedArguments(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Argument(); break; default: jj_la1[75] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } break; default: jj_la1[76] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } break; default: jj_la1[77] = jj_gen; ; } jj_consume_token(RPAREN); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void Argument() throws ParseException { if (jj_2_22(2)) { NamedArgument(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_la1[78] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void NamedArguments() throws ParseException { NamedArgument(); label_24: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMA: ; break; default: jj_la1[79] = jj_gen; break label_24; } jj_consume_token(COMMA); NamedArgument(); } } final public void NamedArgument() throws ParseException { /*@bgen(jjtree) NamedArgument */ AstNamedArgument jjtn000 = new AstNamedArgument(JJTNAMEDARGUMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(IDENTIFIER); jjtn000._data = token.image; jj_consume_token(COLON); Expression(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void AllocationExpression() throws ParseException { if (jj_2_23(2)) { jj_consume_token(NEW); PrimitiveType(); AstArrayAllocationExpression jjtn001 = new AstArrayAllocationExpression(JJTARRAYALLOCATIONEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { ArrayDimsAndInits(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case NEW: jj_consume_token(NEW); Name(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: AstArrayAllocationExpression jjtn002 = new AstArrayAllocationExpression(JJTARRAYALLOCATIONEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { ArrayDimsAndInits(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } break; case LPAREN: AstObjectAllocationExpression jjtn003 = new AstObjectAllocationExpression(JJTOBJECTALLOCATIONEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { Arguments(); } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte003;} } if (jjte003 instanceof ParseException) { {if (true) throw (ParseException)jjte003;} } {if (true) throw (Error)jjte003;} } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } break; default: jj_la1[80] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: jj_la1[81] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } /* * The second LOOKAHEAD specification below is to parse to PrimarySuffix * if there is an expression between the "[...]". */ final public void ArrayDimsAndInits() throws ParseException { if (jj_2_26(2)) { AstArrayDims jjtn001 = new AstArrayDims(JJTARRAYDIMS); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { label_25: while (true) { jj_consume_token(LBRACKET); Expression(); jj_consume_token(RBRACKET); if (jj_2_24(2)) { ; } else { break label_25; } } label_26: while (true) { if (jj_2_25(2)) { ; } else { break label_26; } jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); } } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: label_27: while (true) { jj_consume_token(LBRACKET); jj_consume_token(RBRACKET); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case LBRACKET: ; break; default: jj_la1[82] = jj_gen; break label_27; } } ArrayInitializer(); break; default: jj_la1[83] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } final public void LabeledStatement() throws ParseException { /*@bgen(jjtree) LabeledStatement */ AstLabeledStatement jjtn000 = new AstLabeledStatement(JJTLABELEDSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(IDENTIFIER); jjtn000._data= token.image; jj_consume_token(COLON); JavaStatement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void Block() throws ParseException { /*@bgen(jjtree) Block */ AstBlock jjtn000 = new AstBlock(JJTBLOCK); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(LBRACE); label_28: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CONTENT: case BQ_IN: case BQBQ: case JSP_DIRECTIVE: case JSP_DECLARATION: case JSP_DECLARATION_TAG: case JSP_EXPRESSION: case JSP_EXPRESSION_TAG: case JSP_EL: case NO_PARSE_CONTENT: case BOOLEAN: case BREAK: case BYTE: case CHAR: case CONTINUE: case DO: case DOUBLE: case FLOAT: case FOR: case IF: case IMPORT: case INT: case LONG: case NEW: case RETURN: case SHORT: case STATIC: case SWITCH: case SYNCHRONIZED: case THROW: case TRY: case VOID: case WHILE: case ASSERT: case VAR: case FUNCTION: case EXIT: case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LBRACE: case LPAREN: case SEMICOLON: case INCR: case DECR: ; break; default: jj_la1[84] = jj_gen; break label_28; } JxpStatement(); } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void EmptyStatement() throws ParseException { /*@bgen(jjtree) EmptyStatement */ AstEmptyStatement jjtn000 = new AstEmptyStatement(JJTEMPTYSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(SEMICOLON); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void StatementExpression() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case INCR: jj_consume_token(INCR); AstPreIncrementExpression jjtn001 = new AstPreIncrementExpression(JJTPREINCREMENTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { PrimaryExpression(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } break; case DECR: jj_consume_token(DECR); AstPreDecrementExpression jjtn002 = new AstPreDecrementExpression(JJTPREDECREMENTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { PrimaryExpression(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, true); jjtreeCloseNodeScope(jjtn002); } } break; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: 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: AstPostIncrementExpression jjtn003 = new AstPostIncrementExpression(JJTPOSTINCREMENTEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); try { jj_consume_token(INCR); } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 1); jjtreeCloseNodeScope(jjtn003); } } break; case DECR: AstPostDecrementExpression jjtn004 = new AstPostDecrementExpression(JJTPOSTDECREMENTEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); try { jj_consume_token(DECR); } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, 1); jjtreeCloseNodeScope(jjtn004); } } break; case ASSIGN: jj_consume_token(ASSIGN); AstAssignExpression jjtn005 = new AstAssignExpression(JJTASSIGNEXPRESSION); boolean jjtc005 = true; jjtree.openNodeScope(jjtn005); jjtreeOpenNodeScope(jjtn005); try { Expression(); } catch (Throwable jjte005) { if (jjtc005) { jjtree.clearNodeScope(jjtn005); jjtc005 = false; } else { jjtree.popNode(); } if (jjte005 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte005;} } if (jjte005 instanceof ParseException) { {if (true) throw (ParseException)jjte005;} } {if (true) throw (Error)jjte005;} } finally { if (jjtc005) { jjtree.closeNodeScope(jjtn005, 2); jjtreeCloseNodeScope(jjtn005); } } break; case STARASSIGN: jj_consume_token(STARASSIGN); AstMultiplyAssignExpression jjtn006 = new AstMultiplyAssignExpression(JJTMULTIPLYASSIGNEXPRESSION); boolean jjtc006 = true; jjtree.openNodeScope(jjtn006); jjtreeOpenNodeScope(jjtn006); try { Expression(); } catch (Throwable jjte006) { if (jjtc006) { jjtree.clearNodeScope(jjtn006); jjtc006 = false; } else { jjtree.popNode(); } if (jjte006 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte006;} } if (jjte006 instanceof ParseException) { {if (true) throw (ParseException)jjte006;} } {if (true) throw (Error)jjte006;} } finally { if (jjtc006) { jjtree.closeNodeScope(jjtn006, 2); jjtreeCloseNodeScope(jjtn006); } } break; case SLASHASSIGN: jj_consume_token(SLASHASSIGN); AstDivideAssignExpression jjtn007 = new AstDivideAssignExpression(JJTDIVIDEASSIGNEXPRESSION); boolean jjtc007 = true; jjtree.openNodeScope(jjtn007); jjtreeOpenNodeScope(jjtn007); try { Expression(); } catch (Throwable jjte007) { if (jjtc007) { jjtree.clearNodeScope(jjtn007); jjtc007 = false; } else { jjtree.popNode(); } if (jjte007 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte007;} } if (jjte007 instanceof ParseException) { {if (true) throw (ParseException)jjte007;} } {if (true) throw (Error)jjte007;} } finally { if (jjtc007) { jjtree.closeNodeScope(jjtn007, 2); jjtreeCloseNodeScope(jjtn007); } } break; case REMASSIGN: jj_consume_token(REMASSIGN); AstRemAssignExpression jjtn008 = new AstRemAssignExpression(JJTREMASSIGNEXPRESSION); boolean jjtc008 = true; jjtree.openNodeScope(jjtn008); jjtreeOpenNodeScope(jjtn008); try { Expression(); } catch (Throwable jjte008) { if (jjtc008) { jjtree.clearNodeScope(jjtn008); jjtc008 = false; } else { jjtree.popNode(); } if (jjte008 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte008;} } if (jjte008 instanceof ParseException) { {if (true) throw (ParseException)jjte008;} } {if (true) throw (Error)jjte008;} } finally { if (jjtc008) { jjtree.closeNodeScope(jjtn008, 2); jjtreeCloseNodeScope(jjtn008); } } break; case PLUSASSIGN: jj_consume_token(PLUSASSIGN); AstPlusAssignExpression jjtn009 = new AstPlusAssignExpression(JJTPLUSASSIGNEXPRESSION); boolean jjtc009 = true; jjtree.openNodeScope(jjtn009); jjtreeOpenNodeScope(jjtn009); try { Expression(); } catch (Throwable jjte009) { if (jjtc009) { jjtree.clearNodeScope(jjtn009); jjtc009 = false; } else { jjtree.popNode(); } if (jjte009 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte009;} } if (jjte009 instanceof ParseException) { {if (true) throw (ParseException)jjte009;} } {if (true) throw (Error)jjte009;} } finally { if (jjtc009) { jjtree.closeNodeScope(jjtn009, 2); jjtreeCloseNodeScope(jjtn009); } } break; case MINUSASSIGN: jj_consume_token(MINUSASSIGN); AstMinusAssignExpression jjtn010 = new AstMinusAssignExpression(JJTMINUSASSIGNEXPRESSION); boolean jjtc010 = true; jjtree.openNodeScope(jjtn010); jjtreeOpenNodeScope(jjtn010); try { Expression(); } catch (Throwable jjte010) { if (jjtc010) { jjtree.clearNodeScope(jjtn010); jjtc010 = false; } else { jjtree.popNode(); } if (jjte010 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte010;} } if (jjte010 instanceof ParseException) { {if (true) throw (ParseException)jjte010;} } {if (true) throw (Error)jjte010;} } finally { if (jjtc010) { jjtree.closeNodeScope(jjtn010, 2); jjtreeCloseNodeScope(jjtn010); } } break; case LSHIFTASSIGN: jj_consume_token(LSHIFTASSIGN); AstLShiftAssignExpression jjtn011 = new AstLShiftAssignExpression(JJTLSHIFTASSIGNEXPRESSION); boolean jjtc011 = true; jjtree.openNodeScope(jjtn011); jjtreeOpenNodeScope(jjtn011); try { Expression(); } catch (Throwable jjte011) { if (jjtc011) { jjtree.clearNodeScope(jjtn011); jjtc011 = false; } else { jjtree.popNode(); } if (jjte011 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte011;} } if (jjte011 instanceof ParseException) { {if (true) throw (ParseException)jjte011;} } {if (true) throw (Error)jjte011;} } finally { if (jjtc011) { jjtree.closeNodeScope(jjtn011, 2); jjtreeCloseNodeScope(jjtn011); } } break; case RSIGNEDSHIFTASSIGN: jj_consume_token(RSIGNEDSHIFTASSIGN); AstRSignedShiftAssignExpression jjtn012 = new AstRSignedShiftAssignExpression(JJTRSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc012 = true; jjtree.openNodeScope(jjtn012); jjtreeOpenNodeScope(jjtn012); try { Expression(); } catch (Throwable jjte012) { if (jjtc012) { jjtree.clearNodeScope(jjtn012); jjtc012 = false; } else { jjtree.popNode(); } if (jjte012 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte012;} } if (jjte012 instanceof ParseException) { {if (true) throw (ParseException)jjte012;} } {if (true) throw (Error)jjte012;} } finally { if (jjtc012) { jjtree.closeNodeScope(jjtn012, 2); jjtreeCloseNodeScope(jjtn012); } } break; case RUNSIGNEDSHIFTASSIGN: jj_consume_token(RUNSIGNEDSHIFTASSIGN); AstRUnsignedShiftAssignExpression jjtn013 = new AstRUnsignedShiftAssignExpression(JJTRUNSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc013 = true; jjtree.openNodeScope(jjtn013); jjtreeOpenNodeScope(jjtn013); try { Expression(); } catch (Throwable jjte013) { if (jjtc013) { jjtree.clearNodeScope(jjtn013); jjtc013 = false; } else { jjtree.popNode(); } if (jjte013 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte013;} } if (jjte013 instanceof ParseException) { {if (true) throw (ParseException)jjte013;} } {if (true) throw (Error)jjte013;} } finally { if (jjtc013) { jjtree.closeNodeScope(jjtn013, 2); jjtreeCloseNodeScope(jjtn013); } } break; case ANDASSIGN: jj_consume_token(ANDASSIGN); AstBitwiseAndAssignExpression jjtn014 = new AstBitwiseAndAssignExpression(JJTBITWISEANDASSIGNEXPRESSION); boolean jjtc014 = true; jjtree.openNodeScope(jjtn014); jjtreeOpenNodeScope(jjtn014); try { Expression(); } catch (Throwable jjte014) { if (jjtc014) { jjtree.clearNodeScope(jjtn014); jjtc014 = false; } else { jjtree.popNode(); } if (jjte014 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte014;} } if (jjte014 instanceof ParseException) { {if (true) throw (ParseException)jjte014;} } {if (true) throw (Error)jjte014;} } finally { if (jjtc014) { jjtree.closeNodeScope(jjtn014, 2); jjtreeCloseNodeScope(jjtn014); } } break; case XORASSIGN: jj_consume_token(XORASSIGN); AstBitwiseXOrAssignExpression jjtn015 = new AstBitwiseXOrAssignExpression(JJTBITWISEXORASSIGNEXPRESSION); boolean jjtc015 = true; jjtree.openNodeScope(jjtn015); jjtreeOpenNodeScope(jjtn015); try { Expression(); } catch (Throwable jjte015) { if (jjtc015) { jjtree.clearNodeScope(jjtn015); jjtc015 = false; } else { jjtree.popNode(); } if (jjte015 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte015;} } if (jjte015 instanceof ParseException) { {if (true) throw (ParseException)jjte015;} } {if (true) throw (Error)jjte015;} } finally { if (jjtc015) { jjtree.closeNodeScope(jjtn015, 2); jjtreeCloseNodeScope(jjtn015); } } break; case ORASSIGN: jj_consume_token(ORASSIGN); AstBitwiseOrAssignExpression jjtn016 = new AstBitwiseOrAssignExpression(JJTBITWISEORASSIGNEXPRESSION); boolean jjtc016 = true; jjtree.openNodeScope(jjtn016); jjtreeOpenNodeScope(jjtn016); try { Expression(); } catch (Throwable jjte016) { if (jjtc016) { jjtree.clearNodeScope(jjtn016); jjtc016 = false; } else { jjtree.popNode(); } if (jjte016 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte016;} } if (jjte016 instanceof ParseException) { {if (true) throw (ParseException)jjte016;} } {if (true) throw (Error)jjte016;} } finally { if (jjtc016) { jjtree.closeNodeScope(jjtn016, 2); jjtreeCloseNodeScope(jjtn016); } } break; default: jj_la1[85] = jj_gen; jj_consume_token(-1); throw new ParseException(); } break; default: jj_la1[86] = jj_gen; ; } break; default: jj_la1[87] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } final public void SwitchStatement() throws ParseException { /*@bgen(jjtree) SwitchStatement */ AstSwitchStatement jjtn000 = new AstSwitchStatement(JJTSWITCHSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(SWITCH); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); jj_consume_token(LBRACE); label_29: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: case _DEFAULT: ; break; default: jj_la1[88] = jj_gen; break label_29; } Case(); } jj_consume_token(RBRACE); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void Case() throws ParseException { /*@bgen(jjtree) Case */ AstCase jjtn000 = new AstCase(JJTCASE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { SwitchLabel(); AstBlock jjtn001 = new AstBlock(JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { label_30: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CONTENT: case BQ_IN: case BQBQ: case JSP_DIRECTIVE: case JSP_DECLARATION: case JSP_DECLARATION_TAG: case JSP_EXPRESSION: case JSP_EXPRESSION_TAG: case JSP_EL: case NO_PARSE_CONTENT: case BOOLEAN: case BREAK: case BYTE: case CHAR: case CONTINUE: case DO: case DOUBLE: case FLOAT: case FOR: case IF: case IMPORT: case INT: case LONG: case NEW: case RETURN: case SHORT: case STATIC: case SWITCH: case SYNCHRONIZED: case THROW: case TRY: case VOID: case WHILE: case ASSERT: case VAR: case FUNCTION: case EXIT: case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LBRACE: case LPAREN: case SEMICOLON: case INCR: case DECR: ; break; default: jj_la1[89] = jj_gen; break label_30; } JxpStatement(); } } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); jjtreeCloseNodeScope(jjtn001); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void SwitchLabel() throws ParseException { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CASE: jj_consume_token(CASE); Expression(); jj_consume_token(COLON); break; case _DEFAULT: jj_consume_token(_DEFAULT); jj_consume_token(COLON); break; default: jj_la1[90] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } final public void IfStatement() throws ParseException { /*@bgen(jjtree) IfStatement */ AstIfStatement jjtn000 = new AstIfStatement(JJTIFSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(IF); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); JavaStatement(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case ELSE: jj_consume_token(ELSE); JavaStatement(); break; default: jj_la1[91] = jj_gen; ; } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void WhileStatement() throws ParseException { /*@bgen(jjtree) WhileStatement */ AstWhileStatement jjtn000 = new AstWhileStatement(JJTWHILESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(WHILE); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); JavaStatement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void DoStatement() throws ParseException { /*@bgen(jjtree) DoStatement */ AstDoStatement jjtn000 = new AstDoStatement(JJTDOSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(DO); JavaStatement(); jj_consume_token(WHILE); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); jj_consume_token(SEMICOLON); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void EnhancedForStatement() throws ParseException { /*@bgen(jjtree) EnhancedForStatement */ AstEnhancedForStatement jjtn000 = new AstEnhancedForStatement(JJTENHANCEDFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(FOR); jj_consume_token(LPAREN); Type(); jj_consume_token(IDENTIFIER); jjtn000._data = token.image; jj_consume_token(COLON); Expression(); jj_consume_token(RPAREN); JavaStatement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void ForStatement() throws ParseException { /*@bgen(jjtree) ForStatement */ AstForStatement jjtn000 = new AstForStatement(JJTFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(FOR); jj_consume_token(LPAREN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case STATIC: case VOID: case VAR: case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: ForInit(); break; default: jj_la1[92] = jj_gen; ; } jj_consume_token(SEMICOLON); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_la1[93] = jj_gen; ; } jj_consume_token(SEMICOLON); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: ForUpdate(); break; default: jj_la1[94] = jj_gen; ; } jj_consume_token(RPAREN); JavaStatement(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void ForInit() throws ParseException { /*@bgen(jjtree) ForInit */ AstForInit jjtn000 = new AstForInit(JJTFORINIT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { if (jj_2_27(2)) { FieldDeclaration(); } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case INCR: case DECR: StatementExpressionList(); break; default: jj_la1[95] = jj_gen; jj_consume_token(-1); throw new ParseException(); } } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void StatementExpressionList() throws ParseException { StatementExpression(); AstStatementExpressionList jjtn001 = new AstStatementExpressionList(JJTSTATEMENTEXPRESSIONLIST); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { label_31: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 173: ; break; default: jj_la1[96] = jj_gen; break label_31; } jj_consume_token(173); StatementExpression(); } } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); jjtreeCloseNodeScope(jjtn001); } } } final public void ForUpdate() throws ParseException { /*@bgen(jjtree) ForUpdate */ AstForUpdate jjtn000 = new AstForUpdate(JJTFORUPDATE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { StatementExpressionList(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void BreakStatement() throws ParseException { /*@bgen(jjtree) BreakStatement */ AstBreakStatement jjtn000 = new AstBreakStatement(JJTBREAKSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(BREAK); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: jj_consume_token(IDENTIFIER); jjtn000._data= token.image; break; default: jj_la1[97] = jj_gen; ; } jj_consume_token(SEMICOLON); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void ContinueStatement() throws ParseException { /*@bgen(jjtree) ContinueStatement */ AstContinueStatement jjtn000 = new AstContinueStatement(JJTCONTINUESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(CONTINUE); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case IDENTIFIER: jj_consume_token(IDENTIFIER); jjtn000._data= token.image; break; default: jj_la1[98] = jj_gen; ; } jj_consume_token(SEMICOLON); } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void ReturnStatement() throws ParseException { /*@bgen(jjtree) ReturnStatement */ AstReturnStatement jjtn000 = new AstReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(RETURN); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: case NEW: case SHORT: case VOID: case VAR: case NULL: case TRUE: case FALSE: case JSP_EMPTY: case JSP_NOT: case INTEGER_LITERAL: case FLOATING_POINT_LITERAL: case CHARACTER_LITERAL: case STRING_LITERAL: case JSP_STRING_LITERAL: case IDENTIFIER: case LPAREN: case BANG: case TILDE: case INCR: case DECR: case PLUS: case MINUS: Expression(); break; default: jj_la1[99] = jj_gen; ; } jj_consume_token(SEMICOLON); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void ThrowStatement() throws ParseException { /*@bgen(jjtree) ThrowStatement */ AstThrowStatement jjtn000 = new AstThrowStatement(JJTTHROWSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(THROW); Expression(); jj_consume_token(SEMICOLON); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void SynchronizedStatement() throws ParseException { /*@bgen(jjtree) SynchronizedStatement */ AstSynchronizedStatement jjtn000 = new AstSynchronizedStatement(JJTSYNCHRONIZEDSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(SYNCHRONIZED); jj_consume_token(LPAREN); Expression(); jj_consume_token(RPAREN); Block(); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void TryStatement() throws ParseException { /*@bgen(jjtree) TryStatement */ AstTryStatement jjtn000 = new AstTryStatement(JJTTRYSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(TRY); Block(); label_32: while (true) { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case CATCH: ; break; default: jj_la1[100] = jj_gen; break label_32; } jj_consume_token(CATCH); jj_consume_token(LPAREN); Type(); VariableDeclaratorId(); jj_consume_token(RPAREN); AstCatchBlock jjtn001 = new AstCatchBlock(JJTCATCHBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); try { Block(); } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte001;} } if (jjte001 instanceof ParseException) { {if (true) throw (ParseException)jjte001;} } {if (true) throw (Error)jjte001;} } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } } } switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case FINALLY: jj_consume_token(FINALLY); AstFinallyBlock jjtn002 = new AstFinallyBlock(JJTFINALLYBLOCK); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); try { Block(); } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte002;} } if (jjte002 instanceof ParseException) { {if (true) throw (ParseException)jjte002;} } {if (true) throw (Error)jjte002;} } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 1); jjtreeCloseNodeScope(jjtn002); } } break; default: jj_la1[101] = jj_gen; ; } } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } // added by Andrea Gini final public void AssertStatement() throws ParseException { /*@bgen(jjtree) AssertStatement */ AstAssertStatement jjtn000 = new AstAssertStatement(JJTASSERTSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(ASSERT); Expression(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COLON: jj_consume_token(COLON); Expression(); break; default: jj_la1[102] = jj_gen; ; } jj_consume_token(SEMICOLON); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final public void PrintStatement() throws ParseException { /*@bgen(jjtree) PrintStatement */ AstPrintStatement jjtn000 = new AstPrintStatement(JJTPRINTSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); try { jj_consume_token(BQ_IN); Expression(); jj_consume_token(BQ_OUT); } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { {if (true) throw (RuntimeException)jjte000;} } if (jjte000 instanceof ParseException) { {if (true) throw (ParseException)jjte000;} } {if (true) throw (Error)jjte000;} } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } } final 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; } finally { jj_save(0, xla); } } final 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; } finally { jj_save(1, xla); } } final 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; } finally { jj_save(2, xla); } } final 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; } finally { jj_save(3, xla); } } final 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; } finally { jj_save(4, xla); } } final 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; } finally { jj_save(5, xla); } } final 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; } finally { jj_save(6, xla); } } final 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; } finally { jj_save(7, xla); } } final 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; } finally { jj_save(8, xla); } } final 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; } finally { jj_save(9, xla); } } final 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; } finally { jj_save(10, xla); } } final 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; } finally { jj_save(11, xla); } } final 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; } finally { jj_save(12, xla); } } final 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; } finally { jj_save(13, xla); } } final 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; } finally { jj_save(14, xla); } } final 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; } finally { jj_save(15, xla); } } final 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; } finally { jj_save(16, xla); } } final 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; } finally { jj_save(17, xla); } } final 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; } finally { jj_save(18, xla); } } final 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; } finally { jj_save(19, xla); } } final 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; } finally { jj_save(20, xla); } } final 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; } finally { jj_save(21, xla); } } final 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; } finally { jj_save(22, xla); } } final 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; } finally { jj_save(23, xla); } } final 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; } finally { jj_save(24, xla); } } final 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; } finally { jj_save(25, xla); } } final 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; } finally { jj_save(26, xla); } } final private boolean jj_3R_109() { if (jj_scan_token(INCR)) return true; return false; } final private boolean jj_3R_61() { if (jj_scan_token(LBRACKET)) return true; if (jj_scan_token(RBRACKET)) return true; return false; } final private boolean jj_3R_108() { if (jj_scan_token(MINUS)) return true; return false; } final private boolean jj_3R_76() { if (jj_scan_token(VAR)) return true; return false; } final private boolean jj_3R_107() { if (jj_scan_token(PLUS)) return true; return false; } final private boolean jj_3R_55() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(87)) { jj_scanpos = xsp; if (jj_3R_80()) return true; } return false; } final private boolean jj_3R_75() { if (jj_scan_token(DOUBLE)) return true; return false; } final private boolean jj_3R_74() { if (jj_scan_token(FLOAT)) return true; return false; } final private boolean jj_3R_73() { if (jj_scan_token(LONG)) return true; return false; } final private boolean jj_3_3() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(78)) jj_scanpos = xsp; if (jj_3R_35()) return true; if (jj_scan_token(IDENTIFIER)) return true; return false; } final private boolean jj_3R_72() { if (jj_scan_token(INT)) return true; return false; } final private boolean jj_3_20() { if (jj_3R_56()) return true; return false; } final private boolean jj_3R_60() { if (jj_3R_37()) return true; return false; } final private boolean jj_3R_71() { if (jj_scan_token(SHORT)) return true; return false; } final private boolean jj_3R_106() { Token xsp; xsp = jj_scanpos; if (jj_3R_107()) { jj_scanpos = xsp; if (jj_3R_108()) { jj_scanpos = xsp; if (jj_3R_109()) { jj_scanpos = xsp; if (jj_3R_110()) { jj_scanpos = xsp; if (jj_3R_111()) return true; } } } } return false; } final private boolean jj_3R_70() { if (jj_scan_token(BYTE)) return true; return false; } final private boolean jj_3_26() { Token xsp; if (jj_3_24()) return true; while (true) { xsp = jj_scanpos; if (jj_3_24()) { jj_scanpos = xsp; break; } } return false; } final private boolean jj_3R_69() { if (jj_scan_token(CHAR)) return true; return false; } final private boolean jj_3R_68() { if (jj_scan_token(BOOLEAN)) return true; return false; } final private boolean jj_3_2() { if (jj_3R_34()) return true; return false; } final private boolean jj_3R_105() { if (jj_3R_106()) return true; return false; } final private boolean jj_3_1() { if (jj_3R_33()) return true; return false; } final private boolean jj_3R_51() { Token xsp; xsp = jj_scanpos; if (jj_3R_68()) { jj_scanpos = xsp; if (jj_3R_69()) { jj_scanpos = xsp; if (jj_3R_70()) { jj_scanpos = xsp; if (jj_3R_71()) { jj_scanpos = xsp; if (jj_3R_72()) { jj_scanpos = xsp; if (jj_3R_73()) { jj_scanpos = xsp; if (jj_3R_74()) { jj_scanpos = xsp; if (jj_3R_75()) { jj_scanpos = xsp; if (jj_3R_76()) return true; } } } } } } } } return false; } final private boolean jj_3R_77() { if (jj_scan_token(NEW)) return true; return false; } final private boolean jj_3R_59() { if (jj_3R_51()) return true; return false; } final private boolean jj_3R_35() { Token xsp; xsp = jj_scanpos; if (jj_3R_59()) { jj_scanpos = xsp; if (jj_3R_60()) return true; } while (true) { xsp = jj_scanpos; if (jj_3R_61()) { jj_scanpos = xsp; break; } } return false; } final private boolean jj_3_23() { if (jj_scan_token(NEW)) return true; if (jj_3R_51()) return true; return false; } final private boolean jj_3R_52() { Token xsp; xsp = jj_scanpos; if (jj_3_23()) { jj_scanpos = xsp; if (jj_3R_77()) return true; } return false; } final private boolean jj_3R_104() { if (jj_3R_105()) return true; return false; } final private boolean jj_3R_57() { if (jj_scan_token(IDENTIFIER)) return true; if (jj_scan_token(COLON)) return true; return false; } final private boolean jj_3R_56() { if (jj_3R_57()) return true; return false; } final private boolean jj_3_21() { if (jj_3R_57()) return true; return false; } final private boolean jj_3R_103() { if (jj_3R_104()) return true; return false; } final private boolean jj_3_22() { if (jj_3R_57()) return true; return false; } final private boolean jj_3_6() { if (jj_scan_token(LPAREN)) return true; if (jj_3R_35()) return true; if (jj_scan_token(DOTDOTDOT)) return true; if (jj_scan_token(IDENTIFIER)) return true; return false; } final private boolean jj_3R_102() { if (jj_3R_103()) return true; return false; } final private boolean jj_3R_96() { if (jj_scan_token(NULL)) return true; return false; } final private boolean jj_3R_95() { if (jj_scan_token(FALSE)) return true; return false; } final private boolean jj_3R_79() { if (jj_scan_token(LPAREN)) return true; return false; } final private boolean jj_3R_94() { if (jj_scan_token(TRUE)) return true; return false; } final private boolean jj_3R_84() { if (jj_3R_87()) return true; return false; } final private boolean jj_3R_101() { if (jj_3R_102()) return true; return false; } final private boolean jj_3R_93() { if (jj_scan_token(JSP_STRING_LITERAL)) return true; return false; } final private boolean jj_3_5() { if (jj_scan_token(COMMA)) return true; if (jj_3R_36()) return true; return false; } final private boolean jj_3R_63() { if (jj_3R_53()) return true; return false; } final private boolean jj_3_27() { if (jj_3R_58()) return true; return false; } final private boolean jj_3R_100() { if (jj_3R_101()) return true; return false; } final private boolean jj_3R_92() { if (jj_scan_token(STRING_LITERAL)) return true; return false; } final private boolean jj_3R_91() { if (jj_scan_token(CHARACTER_LITERAL)) return true; return false; } final private boolean jj_3R_90() { if (jj_scan_token(FLOATING_POINT_LITERAL)) return true; return false; } final private boolean jj_3R_99() { if (jj_3R_100()) return true; return false; } final private boolean jj_3R_89() { if (jj_scan_token(INTEGER_LITERAL)) return true; return false; } final private boolean jj_3R_98() { if (jj_3R_99()) return true; return false; } final private boolean jj_3R_87() { Token xsp; xsp = jj_scanpos; if (jj_3R_89()) { jj_scanpos = xsp; if (jj_3R_90()) { jj_scanpos = xsp; if (jj_3R_91()) { jj_scanpos = xsp; if (jj_3R_92()) { jj_scanpos = xsp; if (jj_3R_93()) { jj_scanpos = xsp; if (jj_3R_94()) { jj_scanpos = xsp; if (jj_3R_95()) { jj_scanpos = xsp; if (jj_3R_96()) return true; } } } } } } } return false; } final private boolean jj_3R_97() { if (jj_3R_98()) return true; return false; } final private boolean jj_3R_83() { if (jj_scan_token(LBRACE)) return true; return false; } final private boolean jj_3R_62() { if (jj_3R_83()) return true; return false; } final private boolean jj_3R_88() { if (jj_3R_97()) return true; return false; } final private boolean jj_3R_36() { Token xsp; xsp = jj_scanpos; if (jj_3R_62()) { jj_scanpos = xsp; if (jj_3R_63()) return true; } return false; } final private boolean jj_3_17() { if (jj_3R_55()) return true; if (jj_scan_token(DOT)) return true; if (jj_scan_token(CLASS)) return true; return false; } final private boolean jj_3R_86() { if (jj_scan_token(IDENTIFIER)) return true; return false; } final private boolean jj_3_19() { if (jj_3R_37()) return true; return false; } final private boolean jj_3R_85() { if (jj_3R_88()) return true; return false; } final private boolean jj_3R_54() { if (jj_scan_token(IDENTIFIER)) return true; if (jj_3R_79()) return true; return false; } final private boolean jj_3R_49() { if (jj_scan_token(ORASSIGN)) return true; return false; } final private boolean jj_3_18() { if (jj_3R_54()) return true; return false; } final private boolean jj_3R_48() { if (jj_scan_token(XORASSIGN)) return true; return false; } final private boolean jj_3R_127() { if (jj_3R_55()) return true; return false; } final private boolean jj_3R_47() { if (jj_scan_token(ANDASSIGN)) return true; return false; } final private boolean jj_3R_82() { if (jj_3R_86()) return true; return false; } final private boolean jj_3R_126() { if (jj_3R_52()) return true; return false; } final private boolean jj_3R_78() { if (jj_3R_85()) return true; return false; } final private boolean jj_3R_46() { if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) return true; return false; } final private boolean jj_3R_125() { if (jj_scan_token(LPAREN)) return true; return false; } final private boolean jj_3R_45() { if (jj_scan_token(RSIGNEDSHIFTASSIGN)) return true; return false; } final private boolean jj_3R_81() { if (jj_scan_token(STATIC)) return true; return false; } final private boolean jj_3R_124() { if (jj_3R_87()) return true; return false; } final private boolean jj_3R_58() { Token xsp; xsp = jj_scanpos; if (jj_3R_81()) jj_scanpos = xsp; if (jj_3R_35()) return true; if (jj_3R_82()) return true; return false; } final private boolean jj_3R_44() { if (jj_scan_token(LSHIFTASSIGN)) return true; return false; } final private boolean jj_3R_43() { if (jj_scan_token(MINUSASSIGN)) return true; return false; } final private boolean jj_3R_42() { if (jj_scan_token(PLUSASSIGN)) return true; return false; } final private boolean jj_3R_41() { if (jj_scan_token(REMASSIGN)) return true; return false; } final private boolean jj_3R_40() { if (jj_scan_token(SLASHASSIGN)) return true; return false; } final private boolean jj_3R_123() { Token xsp; xsp = jj_scanpos; if (jj_3R_124()) { jj_scanpos = xsp; if (jj_3R_125()) { jj_scanpos = xsp; if (jj_3R_126()) { jj_scanpos = xsp; if (jj_3R_127()) { jj_scanpos = xsp; if (jj_3_18()) { jj_scanpos = xsp; if (jj_3_19()) return true; } } } } } return false; } final private boolean jj_3R_39() { if (jj_scan_token(STARASSIGN)) return true; return false; } final private boolean jj_3_16() { if (jj_scan_token(DOT)) return true; if (jj_3R_54()) return true; return false; } final private boolean jj_3R_38() { if (jj_scan_token(ASSIGN)) return true; return false; } final private boolean jj_3_15() { if (jj_scan_token(LBRACKET)) return true; if (jj_3R_53()) return true; return false; } final private boolean jj_3_14() { if (jj_scan_token(DOT)) return true; if (jj_3R_52()) return true; return false; } final private boolean jj_3_13() { if (jj_scan_token(LPAREN)) return true; if (jj_3R_51()) return true; return false; } final private boolean jj_3_9() { Token xsp; xsp = jj_scanpos; if (jj_3R_38()) { jj_scanpos = xsp; if (jj_3R_39()) { jj_scanpos = xsp; if (jj_3R_40()) { jj_scanpos = xsp; if (jj_3R_41()) { jj_scanpos = xsp; if (jj_3R_42()) { jj_scanpos = xsp; if (jj_3R_43()) { jj_scanpos = xsp; if (jj_3R_44()) { jj_scanpos = xsp; if (jj_3R_45()) { jj_scanpos = xsp; if (jj_3R_46()) { jj_scanpos = xsp; if (jj_3R_47()) { jj_scanpos = xsp; if (jj_3R_48()) { jj_scanpos = xsp; if (jj_3R_49()) return true; } } } } } } } } } } } return false; } final private boolean jj_3R_121() { if (jj_scan_token(LPAREN)) return true; return false; } final private boolean jj_3R_122() { if (jj_3R_123()) return true; return false; } final private boolean jj_3R_120() { if (jj_scan_token(LPAREN)) return true; return false; } final private boolean jj_3R_53() { if (jj_3R_78()) return true; return false; } final private boolean jj_3R_118() { Token xsp; xsp = jj_scanpos; if (jj_3R_120()) { jj_scanpos = xsp; if (jj_3R_121()) return true; } return false; } final private boolean jj_3_12() { if (jj_scan_token(LPAREN)) return true; if (jj_3R_37()) return true; if (jj_scan_token(LBRACKET)) return true; return false; } final private boolean jj_3R_119() { if (jj_3R_122()) return true; return false; } final private boolean jj_3R_34() { if (jj_scan_token(IMPORT)) return true; if (jj_scan_token(STATIC)) return true; return false; } final private boolean jj_3_7() { if (jj_scan_token(DOT)) return true; if (jj_scan_token(IDENTIFIER)) return true; return false; } final private boolean jj_3_10() { if (jj_3R_50()) return true; return false; } final private boolean jj_3R_67() { if (jj_scan_token(LPAREN)) return true; if (jj_3R_37()) return true; if (jj_scan_token(RPAREN)) return true; Token xsp; xsp = jj_scanpos; if (jj_scan_token(139)) { jj_scanpos = xsp; if (jj_scan_token(138)) { jj_scanpos = xsp; if (jj_scan_token(127)) { jj_scanpos = xsp; if (jj_scan_token(122)) { jj_scanpos = xsp; if (jj_scan_token(82)) { jj_scanpos = xsp; if (jj_scan_token(79)) { jj_scanpos = xsp; if (jj_scan_token(71)) { jj_scanpos = xsp; if (jj_3R_84()) return true; } } } } } } } return false; } final private boolean jj_3_8() { if (jj_scan_token(LT)) return true; if (jj_3R_37()) return true; if (jj_scan_token(GT)) return true; return false; } final private boolean jj_3R_66() { if (jj_scan_token(LPAREN)) return true; if (jj_3R_37()) return true; if (jj_scan_token(LBRACKET)) return true; if (jj_scan_token(RBRACKET)) return true; return false; } final private boolean jj_3_11() { if (jj_scan_token(LPAREN)) return true; if (jj_3R_51()) return true; return false; } final private boolean jj_3R_50() { Token xsp; xsp = jj_scanpos; if (jj_3_11()) { jj_scanpos = xsp; if (jj_3R_66()) { jj_scanpos = xsp; if (jj_3R_67()) return true; } } return false; } final private boolean jj_3R_117() { if (jj_3R_119()) return true; return false; } final private boolean jj_3R_116() { if (jj_3R_118()) return true; return false; } final private boolean jj_3R_64() { if (jj_scan_token(DOT)) return true; if (jj_scan_token(IDENTIFIER)) return true; return false; } final private boolean jj_3R_115() { if (jj_scan_token(JSP_EMPTY)) return true; return false; } final private boolean jj_3R_65() { if (jj_scan_token(LT)) return true; if (jj_3R_35()) return true; if (jj_scan_token(GT)) return true; return false; } final private boolean jj_3R_114() { Token xsp; xsp = jj_scanpos; if (jj_scan_token(138)) { jj_scanpos = xsp; if (jj_scan_token(108)) return true; } return false; } final private boolean jj_3R_113() { if (jj_scan_token(TILDE)) return true; return false; } final private boolean jj_3_4() { if (jj_scan_token(FOR)) return true; if (jj_scan_token(LPAREN)) return true; if (jj_3R_35()) return true; if (jj_scan_token(IDENTIFIER)) return true; if (jj_scan_token(COLON)) return true; return false; } final private boolean jj_3_25() { if (jj_scan_token(LBRACKET)) return true; if (jj_scan_token(RBRACKET)) return true; return false; } final private boolean jj_3R_37() { if (jj_scan_token(IDENTIFIER)) return true; Token xsp; while (true) { xsp = jj_scanpos; if (jj_3R_64()) { jj_scanpos = xsp; break; } } xsp = jj_scanpos; if (jj_3R_65()) jj_scanpos = xsp; return false; } final private boolean jj_3R_80() { if (jj_3R_35()) return true; return false; } final private boolean jj_3R_111() { if (jj_3R_112()) return true; return false; } final private boolean jj_3_24() { if (jj_scan_token(LBRACKET)) return true; if (jj_3R_53()) return true; return false; } final private boolean jj_3R_112() { Token xsp; xsp = jj_scanpos; if (jj_3R_113()) { jj_scanpos = xsp; if (jj_3R_114()) { jj_scanpos = xsp; if (jj_3R_115()) { jj_scanpos = xsp; if (jj_3R_116()) { jj_scanpos = xsp; if (jj_3R_117()) return true; } } } } return false; } final private boolean jj_3R_110() { if (jj_scan_token(DECR)) return true; return false; } final private boolean jj_3R_33() { if (jj_scan_token(IDENTIFIER)) return true; if (jj_scan_token(COLON)) return true; return false; } public JxpParserTokenManager token_source; JavaCharStream jj_input_stream; public Token token, jj_nt; private int jj_ntk; private Token jj_scanpos, jj_lastpos; private int jj_la; public boolean lookingAhead = false; private boolean jj_semLA; private int jj_gen; final private int[] jj_la1 = new int[103]; static private int[] jj_la1_0; static private int[] jj_la1_1; static private int[] jj_la1_2; static private int[] jj_la1_3; static private int[] jj_la1_4; static private int[] jj_la1_5; static { jj_la1_0(); jj_la1_1(); jj_la1_2(); jj_la1_3(); jj_la1_4(); jj_la1_5(); } private static void jj_la1_0() { jj_la1_0 = new int[] {0x3ff0,0x3ff0,0x2050,0x1f80,0x0,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x3ff0,0x0,0x0,0x0,0x0,0x3ff0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,}; } private static void jj_la1_1() { jj_la1_1 = new int[] {0xb0d27000,0xb0d27000,0x0,0x0,0x0,0x0,0x0,0x0,0x90c25000,0x20102000,0x0,0x0,0x0,0x0,0x0,0x0,0x10825000,0x10825000,0x0,0x0,0x0,0x0,0x0,0x10825000,0x0,0x14825000,0x4000000,0x0,0x10825000,0x0,0x10825000,0x10825000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10825000,0x0,0x0,0x10825000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x10825000,0x10825000,0x10825000,0x10825000,0x0,0x0,0x0,0x0,0x0,0xb0d27000,0x0,0x0,0x10825000,0x208000,0xb0d27000,0x208000,0x1000000,0x10825000,0x10825000,0x10825000,0x10825000,0x0,0x0,0x0,0x10825000,0x10000,0x8000000,0x0,}; } private static void jj_la1_2() { jj_la1_2 = new int[] {0x7acb70aa,0x7acb70aa,0x0,0x0,0x0,0x0,0x0,0x2,0x128120a8,0x684a1000,0x0,0x0,0x4000,0x0,0x0,0x0,0x108020a8,0x108020a8,0x0,0x0,0x0,0x0,0x0,0x10002028,0x0,0x10002028,0x0,0x0,0x10002028,0x0,0x10002028,0x10802028,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x108020a8,0x0,0x0,0x108020a8,0x48080,0x0,0x0,0x0,0x0,0x0,0x0,0x80,0x0,0x0,0x108020a8,0x108020a8,0x108020a8,0x108020a8,0x0,0x0,0x80,0x0,0x0,0x7acb70aa,0x0,0x0,0x108020a8,0x0,0x7acb70aa,0x0,0x0,0x108060a8,0x108020a8,0x108020a8,0x108020a8,0x0,0x0,0x0,0x108020a8,0x0,0x0,0x0,}; } private static void jj_la1_3() { jj_la1_3 = new int[] {0xa7a20007,0xa7a20007,0x0,0x0,0x18,0x4000000,0x4000000,0x0,0xa7a20007,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xa7a21807,0xa7a21807,0x0,0x0,0x20000000,0x80000000,0x0,0x4000000,0x0,0x4000000,0x0,0x0,0x4000000,0x0,0x0,0x4000000,0x0,0x0,0x0,0x100,0x100,0x20,0x20,0x0,0x0,0x0,0x240,0x40,0x200,0x240,0x0,0x6480,0x2000,0x80,0x400,0x4000,0x6480,0x0,0x0,0x0,0x0,0x18000,0x8000,0x10000,0x18000,0x87a21807,0x1000,0x1800,0x87a20007,0x87a20007,0x80000000,0x0,0x0,0x80000000,0x0,0x0,0x83a20007,0x3a20007,0x0,0x87a21807,0x87a21807,0x87a21807,0x87a21807,0x0,0x80000000,0x0,0x0,0x0,0xa7a20007,0x0,0x0,0x87a20007,0x0,0xa7a20007,0x0,0x0,0x87a20007,0x87a21807,0x87a20007,0x87a20007,0x0,0x4000000,0x4000000,0x87a21807,0x0,0x0,0x0,}; } private static void jj_la1_4() { jj_la1_4 = new int[] {0x300008,0x300008,0x0,0x0,0x0,0x0,0x0,0x0,0x300008,0x0,0x20,0x20,0x0,0x10,0x80,0x2,0xf00c00,0xf00c00,0x10,0x0,0x8,0x0,0x2,0x0,0x10,0x0,0x0,0x2000,0x0,0x2,0x0,0x0,0x0,0x80,0x1000,0x40000,0x40000,0x80000,0x80000,0x8000000,0x10000000,0x4000000,0x24000,0x4000,0x20000,0x24000,0x0,0x18300,0x200,0x100,0x8000,0x10000,0x18300,0xc0000000,0xc0000000,0xc00000,0xc00000,0x23000000,0x2000000,0x20000000,0x23000000,0xf00c00,0x400,0xc00,0x0,0xc00,0x0,0x300000,0x300000,0x0,0x22,0x20,0x0,0x0,0x10,0xf00c00,0xf00c00,0xf00c00,0xf00c00,0x10,0x2,0x0,0x2,0x2,0x300008,0x300080,0x300080,0x300000,0x0,0x300008,0x0,0x0,0x300000,0xf00c00,0x300000,0x300000,0x0,0x0,0x0,0xf00c00,0x0,0x0,0x2000,}; } private static void jj_la1_5() { jj_la1_5 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000,0xffe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0xffe,0xffe,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2000,0x0,0x0,0x0,0x0,0x0,0x0,}; } final private JJCalls[] jj_2_rtns = new JJCalls[27]; private boolean jj_rescan = false; private int jj_gc = 0; public JxpParser(java.io.InputStream stream) { jj_input_stream = new JavaCharStream(stream, 1, 1); token_source = new JxpParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 103; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } public void ReInit(java.io.InputStream stream) { jj_input_stream.ReInit(stream, 1, 1); token_source.ReInit(jj_input_stream); token = new Token(); jj_ntk = -1; jjtree.reset(); jj_gen = 0; for (int i = 0; i < 103; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } public JxpParser(java.io.Reader stream) { jj_input_stream = new JavaCharStream(stream, 1, 1); token_source = new JxpParserTokenManager(jj_input_stream); token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 103; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } 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; jjtree.reset(); jj_gen = 0; for (int i = 0; i < 103; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } public JxpParser(JxpParserTokenManager tm) { token_source = tm; token = new Token(); jj_ntk = -1; jj_gen = 0; for (int i = 0; i < 103; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } public void ReInit(JxpParserTokenManager tm) { token_source = tm; token = new Token(); jj_ntk = -1; jjtree.reset(); jj_gen = 0; for (int i = 0; i < 103; i++) jj_la1[i] = -1; for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); } final 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) { jj_gen++; if (++jj_gc > 100) { jj_gc = 0; for (int i = 0; i < jj_2_rtns.length; i++) { JJCalls c = jj_2_rtns[i]; while (c != null) { if (c.gen < jj_gen) c.first = null; c = c.next; } } } return token; } token = oldToken; jj_kind = kind; throw generateParseException(); } static private final class LookaheadSuccess extends java.lang.Error { } final private LookaheadSuccess jj_ls = new LookaheadSuccess(); final 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_rescan) { int i = 0; Token tok = token; while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } if (tok != null) jj_add_error_token(kind, i); } if (jj_scanpos.kind != kind) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; return false; } final public Token getNextToken() { if (token.next != null) token = token.next; else token = token.next = token_source.getNextToken(); jj_ntk = -1; jj_gen++; return token; } final public Token getToken(int index) { Token t = 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; } final 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); } private java.util.Vector jj_expentries = new java.util.Vector(); private int[] jj_expentry; private int jj_kind = -1; private int[] jj_lasttokens = new int[100]; private int jj_endpos; private void jj_add_error_token(int kind, int pos) { if (pos >= 100) return; if (pos == jj_endpos + 1) { jj_lasttokens[jj_endpos++] = kind; } else if (jj_endpos != 0) { jj_expentry = new int[jj_endpos]; for (int i = 0; i < jj_endpos; i++) { jj_expentry[i] = jj_lasttokens[i]; } boolean exists = false; for (java.util.Enumeration e = jj_expentries.elements(); e.hasMoreElements();) { int[] oldentry = (int[])(e.nextElement()); if (oldentry.length == jj_expentry.length) { exists = true; for (int i = 0; i < jj_expentry.length; i++) { if (oldentry[i] != jj_expentry[i]) { exists = false; break; } } if (exists) break; } } if (!exists) jj_expentries.addElement(jj_expentry); if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; } } public ParseException generateParseException() { jj_expentries.removeAllElements(); boolean[] la1tokens = new boolean[174]; for (int i = 0; i < 174; i++) { la1tokens[i] = false; } if (jj_kind >= 0) { la1tokens[jj_kind] = true; jj_kind = -1; } for (int i = 0; i < 103; i++) { if (jj_la1[i] == jj_gen) { for (int j = 0; j < 32; j++) { if ((jj_la1_0[i] & (1< jj_gen) { jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; switch (i) { case 0: jj_3_1(); break; case 1: jj_3_2(); break; case 2: jj_3_3(); break; case 3: jj_3_4(); break; case 4: jj_3_5(); break; case 5: jj_3_6(); break; case 6: jj_3_7(); break; case 7: jj_3_8(); break; case 8: jj_3_9(); break; case 9: jj_3_10(); break; case 10: jj_3_11(); break; case 11: jj_3_12(); break; case 12: jj_3_13(); break; case 13: jj_3_14(); break; case 14: jj_3_15(); break; case 15: jj_3_16(); break; case 16: jj_3_17(); break; case 17: jj_3_18(); break; case 18: jj_3_19(); break; case 19: jj_3_20(); break; case 20: jj_3_21(); break; case 21: jj_3_22(); break; case 22: jj_3_23(); break; case 23: jj_3_24(); break; case 24: jj_3_25(); break; case 25: jj_3_26(); break; case 26: jj_3_27(); break; } } p = p.next; } while (p != null); } jj_rescan = false; } final private void jj_save(int index, int xla) { JJCalls p = jj_2_rtns[index]; while (p.gen > jj_gen) { if (p.next == null) { p = p.next = new JJCalls(); break; } p = p.next; } p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; } static final class JJCalls { int gen; Token first; int arg; JJCalls next; } } jxp-1.6.1/src/java/org/onemind/jxp/parser/JxpParser.jj100644 0 0 563356 10530435355 20024 0ustar 0 0 /*@bgen(jjtree) Generated By:JJTree: Do not edit this line. src/java/org/onemind/jxp/parser\JxpParser.jj */ /*@egen*//* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is JavaCC. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1996-2002 Sun * Microsystems, Inc. All Rights Reserved. */ /* * Altered by Tiong Lee (thlee@onemindsoft.org) extensive to be a JJTree grammar */ options { //JJTree will use an alternate form of the node construction routines where it passes the parser object in. For example, STATIC= false; //If this option is set, it is used in the signature of the generated jjtAccept() methods and the visit() methods. Note: this option will be removed in a later version of JJTree. Don't use it if that bothers you. LOOKAHEAD= 1; CHOICE_AMBIGUITY_CHECK= 2; OTHER_AMBIGUITY_CHECK= 1; DEBUG_PARSER= false; DEBUG_LOOKAHEAD= false; DEBUG_TOKEN_MANAGER= false; ERROR_REPORTING= true; JAVA_UNICODE_ESCAPE= true; UNICODE_INPUT= false; IGNORE_CASE= false; USER_TOKEN_MANAGER= false; USER_CHAR_STREAM= false; BUILD_PARSER= true; BUILD_TOKEN_MANAGER= true; SANITY_CHECK= true; FORCE_LA_CHECK= false; } PARSER_BEGIN(JxpParser) /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.parser; import java.io.*; import java.util.*; import org.onemind.commons.java.lang.*; public class JxpParser/*@bgen(jjtree)*/implements JxpParserTreeConstants/*@egen*/ {/*@bgen(jjtree)*/ protected JJTJxpParserState jjtree = new JJTJxpParserState(); /*@egen*/ public static void main(String args[]) throws ParseException, IOException { System.out.println("Dumping structure for " + args[0]); JxpParser parser= new JxpParser(new FileInputStream(args[0])); AstJxpDocument doc= parser.JxpDocument(); doc.dump(""); } void jjtreeOpenNodeScope(Node n) { ((SimpleNode) n)._line= getToken(0).beginLine; ((SimpleNode) n)._col= getToken(0).beginColumn; } void jjtreeCloseNodeScope(Node n) {} static String normalizeStringLiteral(StringBuffer image, char quote){ String str = image.substring(1, image.length() - 1); //remove the quotes StringBuffer copy = new StringBuffer(); boolean escape = false; for (int i=0; i" : JAVA | "<%!!" : NO_PARSE } TOKEN : { | : JAVA | | : JXP | : JAVA | "> : JAVA | "> : JXP | : JXP } TOKEN : { " ])+> } /* WHITE SPACE */ SKIP : { " " | "\t" | "\n" | "\r" | "\f" | <"%>" ("\r" | "\n" |"\r\n")?> : DEFAULT | <"" ("\r" | "\n" |"\r\n")?> : DEFAULT } SKIP : { " " | "\t" | "\n" | "\r" | "\f" } TOKEN: { " ("\r" | "\n" |"\r\n")?> : DEFAULT | "> : DEFAULT | "> : DEFAULT | : DEFAULT } /* COMMENTS */ MORE : { "//" : IN_SINGLE_LINE_COMMENT | < "/**" ~[ "/" ]> { input_stream.backup(1); } : IN_FORMAL_COMMENT | "/*" : IN_MULTI_LINE_COMMENT } SKIP : { < "!!%>" > : DEFAULT } MORE: { "<%--" : IN_COMMENT } SPECIAL_TOKEN : { "--%>" : DEFAULT | "--%>\r" : DEFAULT | "--%>\n" : DEFAULT | "--%>\r\n" : DEFAULT } SPECIAL_TOKEN : { : JAVA } SPECIAL_TOKEN : { : JAVA } SPECIAL_TOKEN : { : JAVA } MORE : { < ~[ ]> } /* RESERVED WORDS AND LITERALS */ TOKEN : { < ABSTRACT : "abstract"> | < 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"> | < EXTENDS : "extends"> | < 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"> | < PACKAGE : "package"> | < PRIVATE : "private"> | < PROTECTED : "protected"> | < PUBLIC : "public"> | < RETURN : "return"> | < SHORT : "short"> | < STATIC : "static"> | < SUPER : "super"> | < SWITCH : "switch"> | < SYNCHRONIZED : "synchronized"> | < THIS : "this"> | < THROW : "throw"> | < THROWS : "throws"> | < TRANSIENT : "transient"> | < TRY : "try"> | < VOID : "void"> | < VOLATILE : "volatile"> | < WHILE : "while"> | < STRICTFP : "strictfp"> // added by Andrea Gini | < ASSERT : "assert"> | < VAR : "var"> | < FUNCTION: "function"> | < EXIT: "exit"> | } TOKEN : /** shared reserve word **/ { < NULL : "null"> | < TRUE : "true"> | < FALSE : "false"> } TOKEN : { < PAGE: "page"> | < INCLUDE: "include" > } TOKEN : /* expression language */ { < JSP_AND: "and" > | < JSP_EQ: "eq" > | < JSP_GT: "gt" > | < JSP_OR: "or" > | < JSP_NE: "me" > | < JSP_LE: "le" > | < JSP_EMPTY: "empty"> | < JSP_NOT: "not" > | < JSP_LT: "lt" > | < JSP_GE: "ge" > | < JSP_DIV: "div" > | < JSP_MOD: "mod" > } /* LITERALS */ TOKEN : { < INTEGER_LITERAL : ( [ "l", "L" ] )? | ( [ "l", "L" ] )? | ( [ "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" ] )* ( )? ( [ "f", "F", "d", "D" ] )? | "." ( [ "0"-"9" ] )+ ( )? ( [ "f", "F", "d", "D" ] )? | ( [ "0"-"9" ] )+ ( [ "f", "F", "d", "D" ] )? | ( [ "0"-"9" ] )+ ( )? [ "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" ] ) ) )* "\"" > { matchedToken.image = JxpParser.normalizeStringLiteral(image, '\"'); } } TOKEN : { /** jsp EL literal **/ < JSP_STRING_LITERAL : "\'" ( ( ~[ "\'", "\\", "\n", "\r" ] ) | ( "\\" ( [ "n", "t", "b", "r", "f", "\\", "'", "\"" ] | [ "0"-"7" ] ( [ "0"-"7" ] )? | [ "0"-"3" ] [ "0"-"7" ] [ "0"-"7" ] ) ) )* "\'" > { matchedToken.image = JxpParser.normalizeStringLiteral(image, '\''); } } /* IDENTIFIERS */ TOKEN : { < IDENTIFIER : ( | )*> | < #LETTER : [ "$", "A"-"Z", "_", "a"-"z", "\u00c0"-"\u00d6", "\u00d8"-"\u00f6", "\u00f8"-"\u00ff", "\u0100"-"\u1fff", "\u3040"-"\u318f", "\u3300"-"\u337f", "\u3400"-"\u3d2d", "\u4e00"-"\u9fff", "\uf900"-"\ufaff" ] > | < #DIGIT : [ "0"-"9", "\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 : { < LBRACE : "{"> | < RBRACE : "}"> } TOKEN : { < LPAREN : "("> | < RPAREN : ")"> | < LBRACKET : "["> | < RBRACKET : "]"> | < SEMICOLON : ";"> | < COMMA : ","> | < DOT : "."> | < BQ_OUT : "`"> : DEFAULT } /* OPERATORS */ TOKEN : { < ASSIGN : "="> | < GT : ">"> | < 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 : "<<"> | < RSIGNEDSHIFT : ">>"> | < RUNSIGNEDSHIFT : ">>>"> | < PLUSASSIGN : "+="> | < MINUSASSIGN : "-="> | < STARASSIGN : "*="> | < SLASHASSIGN : "/="> | < ANDASSIGN : "&="> | < ORASSIGN : "|="> | < XORASSIGN : "^="> | < REMASSIGN : "%="> | < LSHIFTASSIGN : "<<="> | < RSIGNEDSHIFTASSIGN : ">>="> | < RUNSIGNEDSHIFTASSIGN : ">>>="> } /***************************************** * THE SJI GRAMMER START HERE * *****************************************/ AstJxpDocument JxpDocument() : {/*@bgen(jjtree) JxpDocument */ AstJxpDocument jjtn000 = new AstJxpDocument(JJTJXPDOCUMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) JxpDocument */ try { /*@egen*/ ( JxpStatement() )* /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { return (AstJxpDocument) jjtn000; }/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void JxpStatement() : {} { ( Content() | JavaStatement() | JspStatement() ) } void Content() : {/*@bgen(jjtree) Content */ AstContent jjtn000 = new AstContent(JJTCONTENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) Content */ try { /*@egen*/ /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= token.image; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data = "`"; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data = token.image; }/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void JspStatement() : {} { JspDirective() | FieldDeclaration() { token_source.SwitchTo(JXP); } | FieldDeclaration() { token_source.SwitchTo(JXP); } | Expression()/*@bgen(jjtree) #PrintStatement( 1) */ { AstPrintStatement jjtn001 = new AstPrintStatement(JJTPRINTSTATEMENT); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | Expression()/*@bgen(jjtree) #PrintStatement( 1) */ { AstPrintStatement jjtn002 = new AstPrintStatement(JJTPRINTSTATEMENT); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 1); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | Expression()/*@bgen(jjtree) #PrintStatement( 1) */ { AstPrintStatement jjtn003 = new AstPrintStatement(JJTPRINTSTATEMENT); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 1); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ } void JspDirective() : {} { PageDirective() | IncludeDirective() } void PageDirective() : {/*@bgen(jjtree) PageDirective */ AstPageDirective jjtn000 = new AstPageDirective(JJTPAGEDIRECTIVE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/ Map attrs = new HashMap(); jjtn000._data = attrs; String id = null; } {/*@bgen(jjtree) PageDirective */ try { /*@egen*/ ( { id = token.image; } { String str = token.image; attrs.put(id, str ); } )+/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void IncludeDirective() : {/*@bgen(jjtree) IncludeDirective */ AstIncludeDirective jjtn000 = new AstIncludeDirective(JJTINCLUDEDIRECTIVE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/ Map attrs = new HashMap(); jjtn000._data = attrs; String id = null; } {/*@bgen(jjtree) IncludeDirective */ try { /*@egen*/ ( { id = token.image; } { String str = token.image; attrs.put(id, str ); } )+/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } /***************************************** * Supported java grammer start here * *****************************************/ void JavaStatement() : {} { LOOKAHEAD(2) LabeledStatement() | LOOKAHEAD(2) StaticImportDeclaration() | ImportDeclaration() | LOOKAHEAD([] Type() ) FieldDeclaration() | Block() | EmptyStatement() | StatementExpression() | SwitchStatement() | IfStatement() | WhileStatement() | DoStatement() | LOOKAHEAD ( Type() ) EnhancedForStatement() | ForStatement() | BreakStatement() | ContinueStatement() | ReturnStatement() | ThrowStatement() | SynchronizedStatement() | TryStatement() // added by Andrea Gini | AssertStatement() | // LOOKAHEAD(MethodDeclarationLookahead() ) FunctionDeclaration() | PrintStatement() | ExitStatement() } void StaticImportDeclaration() : {/*@bgen(jjtree) StaticImportDeclaration */ AstStaticImportDeclaration jjtn000 = new AstStaticImportDeclaration(JJTSTATICIMPORTDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) StaticImportDeclaration */ try { /*@egen*/ Name() [ { jjtn000._data= token.image; } ] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ImportDeclaration() : {/*@bgen(jjtree) ImportDeclaration */ AstImportDeclaration jjtn000 = new AstImportDeclaration(JJTIMPORTDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ImportDeclaration */ try { /*@egen*/ Name() [ { jjtn000._data= token.image; } ] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } /* // This production is to determine lookahead only. void MethodDeclarationLookahead() #void: {} { ( | | | | | | | | "strictfp" )? ResultType() "(" } */ void FieldDeclaration() : {/*@bgen(jjtree) FieldDeclaration */ AstFieldDeclaration jjtn000 = new AstFieldDeclaration(JJTFIELDDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) FieldDeclaration */ try { /*@egen*/ [ { jjtn000._data = token.image; } ] Type() VariableDeclarator() ( VariableDeclarator() )*/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void VariableDeclarator() : {/*@bgen(jjtree) VariableDeclarator */ AstVariableDeclarator jjtn000 = new AstVariableDeclarator(JJTVARIABLEDECLARATOR); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) VariableDeclarator */ try { /*@egen*/ VariableDeclaratorId() [ VariableInitializer() ]/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void VariableDeclaratorId() : {/*@bgen(jjtree) VariableDeclaratorId */ AstVariableDeclaratorId jjtn000 = new AstVariableDeclaratorId(JJTVARIABLEDECLARATORID); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/ AstVariableDeclaratorId idNode = (AstVariableDeclaratorId)jjtn000; } {/*@bgen(jjtree) VariableDeclaratorId */ try { /*@egen*/ { jjtn000._data = token.image; } ( { idNode._dim++; } )*/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void VariableInitializer() : {} { ( ArrayInitializer() | Expression() ) } void ArrayInitializer() : {/*@bgen(jjtree) ArrayInitializer */ AstArrayInitializer jjtn000 = new AstArrayInitializer(JJTARRAYINITIALIZER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ArrayInitializer */ try { /*@egen*/ [ VariableInitializer() ( LOOKAHEAD(2) VariableInitializer() )* ] [ ] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ExitStatement() : {/*@bgen(jjtree) ExitStatement */ AstExitStatement jjtn000 = new AstExitStatement(JJTEXITSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ExitStatement */ try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void FunctionDeclaration() : {/*@bgen(jjtree) FunctionDeclaration */ AstFunctionDeclaration jjtn000 = new AstFunctionDeclaration(JJTFUNCTIONDECLARATION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) FunctionDeclaration */ try { /*@egen*/ ResultType() FunctionDeclarator() [ "throws" NameList() ] ( Block() | )/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void FunctionDeclarator() : {/*@bgen(jjtree) FunctionDeclarator */ AstFunctionDeclarator jjtn000 = new AstFunctionDeclarator(JJTFUNCTIONDECLARATOR); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) FunctionDeclarator */ try { /*@egen*/ { jjtn000._data = token.image; } ( LOOKAHEAD ( Type() ) VariableParameters() | FormalParameters() ) ( )*/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void VariableParameters() : {/*@bgen(jjtree) VariableParameters */ AstVariableParameters jjtn000 = new AstVariableParameters(JJTVARIABLEPARAMETERS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) VariableParameters */ try { /*@egen*/ [ Type() { jjtn000._data = token.image; } ] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void FormalParameters() : {/*@bgen(jjtree) FormalParameters */ AstFormalParameters jjtn000 = new AstFormalParameters(JJTFORMALPARAMETERS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) FormalParameters */ try { /*@egen*/ [ FormalParameter() ( FormalParameter() )* ] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void FormalParameter() : {/*@bgen(jjtree) FormalParameter */ AstFormalParameter jjtn000 = new AstFormalParameter(JJTFORMALPARAMETER); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/ } {/*@bgen(jjtree) FormalParameter */ try { /*@egen*/ [ ] Type() VariableDeclaratorId() [ Expression() ]/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } /* * Type, name and expression syntax follows. */ void Type() : {/*@bgen(jjtree) Type */ AstType jjtn000 = new AstType(JJTTYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/ AstType typeNode = (AstType)jjtn000; } {/*@bgen(jjtree) Type */ try { /*@egen*/ ( PrimitiveType() | Name() ) ( { typeNode._dim++; } )*/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void PrimitiveType() : {/*@bgen(jjtree) PrimitiveType */ AstPrimitiveType jjtn000 = new AstPrimitiveType(JJTPRIMITIVETYPE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) PrimitiveType */ try { /*@egen*/ ( /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Boolean.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Character.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Byte.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Short.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Integer.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Long.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Float.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Double.TYPE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Object.class; } )/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ResultType() : {} { | Type() } void Name() : /* * A lookahead of 2 is required below since "Name" can be followed * by a ".*" when used in the context of an "ImportDeclaration". */ {/*@bgen(jjtree) Name */ AstName jjtn000 = new AstName(JJTNAME); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/ List l= new ArrayList(); } {/*@bgen(jjtree) Name */ try { /*@egen*/ { l.add(token.image); } ( LOOKAHEAD( , { getToken(3).kind != LPAREN }) { l.add(token.image); } )* [ LOOKAHEAD( Name() ) Type() ]/*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= l; }/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void NameList() : {/*@bgen(jjtree) NameList */ AstNameList jjtn000 = new AstNameList(JJTNAMELIST); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) NameList */ try { /*@egen*/ Name() ( "," Name() )*/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } /* * Expression syntax follows. */ void 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. */ { } { ( ConditionalExpression() [ LOOKAHEAD( 1, { getToken(1).specialToken == null } ) ( /*@bgen(jjtree) #AssignExpression( 2) */ { AstAssignExpression jjtn001 = new AstAssignExpression(JJTASSIGNEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | /*@bgen(jjtree) #MultiplyAssignExpression( 2) */ { AstMultiplyAssignExpression jjtn002 = new AstMultiplyAssignExpression(JJTMULTIPLYASSIGNEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | /*@bgen(jjtree) #DivideAssignExpression( 2) */ { AstDivideAssignExpression jjtn003 = new AstDivideAssignExpression(JJTDIVIDEASSIGNEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ | /*@bgen(jjtree) #RemAssignExpression( 2) */ { AstRemAssignExpression jjtn004 = new AstRemAssignExpression(JJTREMASSIGNEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte004) { if (jjtc004) { jjtree.clearNodeScope(jjtn004); jjtc004 = false; } else { jjtree.popNode(); } if (jjte004 instanceof RuntimeException) { throw (RuntimeException)jjte004; } if (jjte004 instanceof ParseException) { throw (ParseException)jjte004; } throw (Error)jjte004; } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, 2); jjtreeCloseNodeScope(jjtn004); } } /*@egen*/ | /*@bgen(jjtree) #PlusAssignExpression( 2) */ { AstPlusAssignExpression jjtn005 = new AstPlusAssignExpression(JJTPLUSASSIGNEXPRESSION); boolean jjtc005 = true; jjtree.openNodeScope(jjtn005); jjtreeOpenNodeScope(jjtn005); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte005) { if (jjtc005) { jjtree.clearNodeScope(jjtn005); jjtc005 = false; } else { jjtree.popNode(); } if (jjte005 instanceof RuntimeException) { throw (RuntimeException)jjte005; } if (jjte005 instanceof ParseException) { throw (ParseException)jjte005; } throw (Error)jjte005; } finally { if (jjtc005) { jjtree.closeNodeScope(jjtn005, 2); jjtreeCloseNodeScope(jjtn005); } } /*@egen*/ | /*@bgen(jjtree) #MinusAssignExpression( 2) */ { AstMinusAssignExpression jjtn006 = new AstMinusAssignExpression(JJTMINUSASSIGNEXPRESSION); boolean jjtc006 = true; jjtree.openNodeScope(jjtn006); jjtreeOpenNodeScope(jjtn006); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte006) { if (jjtc006) { jjtree.clearNodeScope(jjtn006); jjtc006 = false; } else { jjtree.popNode(); } if (jjte006 instanceof RuntimeException) { throw (RuntimeException)jjte006; } if (jjte006 instanceof ParseException) { throw (ParseException)jjte006; } throw (Error)jjte006; } finally { if (jjtc006) { jjtree.closeNodeScope(jjtn006, 2); jjtreeCloseNodeScope(jjtn006); } } /*@egen*/ | /*@bgen(jjtree) #LShiftAssignExpression( 2) */ { AstLShiftAssignExpression jjtn007 = new AstLShiftAssignExpression(JJTLSHIFTASSIGNEXPRESSION); boolean jjtc007 = true; jjtree.openNodeScope(jjtn007); jjtreeOpenNodeScope(jjtn007); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte007) { if (jjtc007) { jjtree.clearNodeScope(jjtn007); jjtc007 = false; } else { jjtree.popNode(); } if (jjte007 instanceof RuntimeException) { throw (RuntimeException)jjte007; } if (jjte007 instanceof ParseException) { throw (ParseException)jjte007; } throw (Error)jjte007; } finally { if (jjtc007) { jjtree.closeNodeScope(jjtn007, 2); jjtreeCloseNodeScope(jjtn007); } } /*@egen*/ | /*@bgen(jjtree) #RSignedShiftAssignExpression( 2) */ { AstRSignedShiftAssignExpression jjtn008 = new AstRSignedShiftAssignExpression(JJTRSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc008 = true; jjtree.openNodeScope(jjtn008); jjtreeOpenNodeScope(jjtn008); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte008) { if (jjtc008) { jjtree.clearNodeScope(jjtn008); jjtc008 = false; } else { jjtree.popNode(); } if (jjte008 instanceof RuntimeException) { throw (RuntimeException)jjte008; } if (jjte008 instanceof ParseException) { throw (ParseException)jjte008; } throw (Error)jjte008; } finally { if (jjtc008) { jjtree.closeNodeScope(jjtn008, 2); jjtreeCloseNodeScope(jjtn008); } } /*@egen*/ | /*@bgen(jjtree) #RUnsignedShiftAssignExpression( 2) */ { AstRUnsignedShiftAssignExpression jjtn009 = new AstRUnsignedShiftAssignExpression(JJTRUNSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc009 = true; jjtree.openNodeScope(jjtn009); jjtreeOpenNodeScope(jjtn009); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte009) { if (jjtc009) { jjtree.clearNodeScope(jjtn009); jjtc009 = false; } else { jjtree.popNode(); } if (jjte009 instanceof RuntimeException) { throw (RuntimeException)jjte009; } if (jjte009 instanceof ParseException) { throw (ParseException)jjte009; } throw (Error)jjte009; } finally { if (jjtc009) { jjtree.closeNodeScope(jjtn009, 2); jjtreeCloseNodeScope(jjtn009); } } /*@egen*/ | /*@bgen(jjtree) #BitwiseAndAssignExpression( 2) */ { AstBitwiseAndAssignExpression jjtn010 = new AstBitwiseAndAssignExpression(JJTBITWISEANDASSIGNEXPRESSION); boolean jjtc010 = true; jjtree.openNodeScope(jjtn010); jjtreeOpenNodeScope(jjtn010); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte010) { if (jjtc010) { jjtree.clearNodeScope(jjtn010); jjtc010 = false; } else { jjtree.popNode(); } if (jjte010 instanceof RuntimeException) { throw (RuntimeException)jjte010; } if (jjte010 instanceof ParseException) { throw (ParseException)jjte010; } throw (Error)jjte010; } finally { if (jjtc010) { jjtree.closeNodeScope(jjtn010, 2); jjtreeCloseNodeScope(jjtn010); } } /*@egen*/ | /*@bgen(jjtree) #BitwiseXOrAssignExpression( 2) */ { AstBitwiseXOrAssignExpression jjtn011 = new AstBitwiseXOrAssignExpression(JJTBITWISEXORASSIGNEXPRESSION); boolean jjtc011 = true; jjtree.openNodeScope(jjtn011); jjtreeOpenNodeScope(jjtn011); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte011) { if (jjtc011) { jjtree.clearNodeScope(jjtn011); jjtc011 = false; } else { jjtree.popNode(); } if (jjte011 instanceof RuntimeException) { throw (RuntimeException)jjte011; } if (jjte011 instanceof ParseException) { throw (ParseException)jjte011; } throw (Error)jjte011; } finally { if (jjtc011) { jjtree.closeNodeScope(jjtn011, 2); jjtreeCloseNodeScope(jjtn011); } } /*@egen*/ | /*@bgen(jjtree) #BitwiseOrAssignExpression( 2) */ { AstBitwiseOrAssignExpression jjtn012 = new AstBitwiseOrAssignExpression(JJTBITWISEORASSIGNEXPRESSION); boolean jjtc012 = true; jjtree.openNodeScope(jjtn012); jjtreeOpenNodeScope(jjtn012); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte012) { if (jjtc012) { jjtree.clearNodeScope(jjtn012); jjtc012 = false; } else { jjtree.popNode(); } if (jjte012 instanceof RuntimeException) { throw (RuntimeException)jjte012; } if (jjte012 instanceof ParseException) { throw (ParseException)jjte012; } throw (Error)jjte012; } finally { if (jjtc012) { jjtree.closeNodeScope(jjtn012, 2); jjtreeCloseNodeScope(jjtn012); } } /*@egen*/ ) ] ) } void ConditionalExpression() : {} { ( ConditionalOrExpression() [ Expression() /*@bgen(jjtree) #HookExpression( 3) */ { AstHookExpression jjtn001 = new AstHookExpression(JJTHOOKEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ ConditionalExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ ] ) } void ConditionalOrExpression() : {} { ConditionalAndExpression() ( ( | )/*@bgen(jjtree) #ConditionalOrExpression( 2) */ { AstConditionalOrExpression jjtn001 = new AstConditionalOrExpression(JJTCONDITIONALOREXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ ConditionalAndExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ )* } void ConditionalAndExpression() : {} { BitwiseOrExpression() ( (|)/*@bgen(jjtree) #ConditionalAndExpression( 2) */ { AstConditionalAndExpression jjtn001 = new AstConditionalAndExpression(JJTCONDITIONALANDEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ BitwiseOrExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ )* } void BitwiseOrExpression() : {} { BitwiseXOrExpression() ( /*@bgen(jjtree) #BitwiseOrExpression( 2) */ { AstBitwiseOrExpression jjtn001 = new AstBitwiseOrExpression(JJTBITWISEOREXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ BitwiseXOrExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ )* } void BitwiseXOrExpression() : {} { BitwiseAndExpression() ( /*@bgen(jjtree) #BitwiseXOrExpression( 2) */ { AstBitwiseXOrExpression jjtn001 = new AstBitwiseXOrExpression(JJTBITWISEXOREXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ BitwiseAndExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ )* } void BitwiseAndExpression() : {} { EqualityExpression() ( /*@bgen(jjtree) #BitwiseAndExpression( 2) */ { AstBitwiseAndExpression jjtn001 = new AstBitwiseAndExpression(JJTBITWISEANDEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ EqualityExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ )* } void EqualityExpression() : {} { InstanceOfExpression() ( ( | )/*@bgen(jjtree) #EQExpression( 2) */ { AstEQExpression jjtn001 = new AstEQExpression(JJTEQEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ InstanceOfExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | ( | )/*@bgen(jjtree) #NEExpression( 2) */ { AstNEExpression jjtn002 = new AstNEExpression(JJTNEEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ InstanceOfExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ )* } void InstanceOfExpression() : {} { RelationalExpression() [ /*@bgen(jjtree) #InstanceOfExpression( 2) */ { AstInstanceOfExpression jjtn001 = new AstInstanceOfExpression(JJTINSTANCEOFEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ Type()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ ] } void RelationalExpression() : {} { ShiftExpression() ( ( | )/*@bgen(jjtree) #LTExpression( 2) */ { AstLTExpression jjtn001 = new AstLTExpression(JJTLTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ ShiftExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | ( | )/*@bgen(jjtree) #GTExpression( 2) */ { AstGTExpression jjtn002 = new AstGTExpression(JJTGTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ ShiftExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | ( | )/*@bgen(jjtree) #LEExpression( 2) */ { AstLEExpression jjtn003 = new AstLEExpression(JJTLEEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ ShiftExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ | ( | )/*@bgen(jjtree) #GEExpression( 2) */ { AstGEExpression jjtn004 = new AstGEExpression(JJTGEEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); } try { /*@egen*/ ShiftExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte004) { if (jjtc004) { jjtree.clearNodeScope(jjtn004); jjtc004 = false; } else { jjtree.popNode(); } if (jjte004 instanceof RuntimeException) { throw (RuntimeException)jjte004; } if (jjte004 instanceof ParseException) { throw (ParseException)jjte004; } throw (Error)jjte004; } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, 2); jjtreeCloseNodeScope(jjtn004); } } /*@egen*/ )* } void ShiftExpression() : {} { AdditiveExpression() ( /*@bgen(jjtree) #LShiftExpression( 2) */ { AstLShiftExpression jjtn001 = new AstLShiftExpression(JJTLSHIFTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | /*@bgen(jjtree) #RSignedShiftExpression( 2) */ { AstRSignedShiftExpression jjtn002 = new AstRSignedShiftExpression(JJTRSIGNEDSHIFTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | /*@bgen(jjtree) #RUnsignedShiftExpression( 2) */ { AstRUnsignedShiftExpression jjtn003 = new AstRUnsignedShiftExpression(JJTRUNSIGNEDSHIFTEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ AdditiveExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ )* } void AdditiveExpression() : {} { MultiplicativeExpression() ( /*@bgen(jjtree) #PlusExpression( 2) */ { AstPlusExpression jjtn001 = new AstPlusExpression(JJTPLUSEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ MultiplicativeExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | /*@bgen(jjtree) #MinusExpression( 2) */ { AstMinusExpression jjtn002 = new AstMinusExpression(JJTMINUSEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ MultiplicativeExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ )* } void MultiplicativeExpression() : {} { UnaryExpression() ( /*@bgen(jjtree) #MultiplyExpression( 2) */ { AstMultiplyExpression jjtn001 = new AstMultiplyExpression(JJTMULTIPLYEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | ( | )/*@bgen(jjtree) #DivideExpression( 2) */ { AstDivideExpression jjtn002 = new AstDivideExpression(JJTDIVIDEEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | ( | )/*@bgen(jjtree) #RemainderExpression( 2) */ { AstRemainderExpression jjtn003 = new AstRemainderExpression(JJTREMAINDEREXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ )* } void UnaryExpression() : {} { ( /*@bgen(jjtree) #UnaryPlusExpression( true) */ { AstUnaryPlusExpression jjtn001 = new AstUnaryPlusExpression(JJTUNARYPLUSEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | /*@bgen(jjtree) #UnaryMinusExpression( true) */ { AstUnaryMinusExpression jjtn002 = new AstUnaryMinusExpression(JJTUNARYMINUSEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, true); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | /*@bgen(jjtree) #PreIncrementExpression( true) */ { AstPreIncrementExpression jjtn003 = new AstPreIncrementExpression(JJTPREINCREMENTEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ PrimaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, true); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ | /*@bgen(jjtree) #PreDecrementExpression( true) */ { AstPreDecrementExpression jjtn004 = new AstPreDecrementExpression(JJTPREDECREMENTEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); } try { /*@egen*/ PrimaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte004) { if (jjtc004) { jjtree.clearNodeScope(jjtn004); jjtc004 = false; } else { jjtree.popNode(); } if (jjte004 instanceof RuntimeException) { throw (RuntimeException)jjte004; } if (jjte004 instanceof ParseException) { throw (ParseException)jjte004; } throw (Error)jjte004; } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, true); jjtreeCloseNodeScope(jjtn004); } } /*@egen*/ | UnaryExpressionNotPlusMinus() ) } void UnaryExpressionNotPlusMinus() : {} { ( /*@bgen(jjtree) #BitwiseComplementExpression( true) */ { AstBitwiseComplementExpression jjtn001 = new AstBitwiseComplementExpression(JJTBITWISECOMPLEMENTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | ( | )/*@bgen(jjtree) #LogicalComplementExpression( true) */ { AstLogicalComplementExpression jjtn002 = new AstLogicalComplementExpression(JJTLOGICALCOMPLEMENTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, true); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | /*@bgen(jjtree) #IsEmptyExpression( true) */ { AstIsEmptyExpression jjtn003 = new AstIsEmptyExpression(JJTISEMPTYEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ UnaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, true); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ | LOOKAHEAD(CastLookahead() ) CastExpression() | PostfixExpression() ) } // 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( Name() ) Name() | Name() ( | | | | | | | Literal() ) } void PostfixExpression() : {} { PrimaryExpression() [/*@bgen(jjtree) #PostIncrementExpression( 1) */ { AstPostIncrementExpression jjtn001 = new AstPostIncrementExpression(JJTPOSTINCREMENTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 1); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ |/*@bgen(jjtree) #PostDecrementExpression( 1) */ { AstPostDecrementExpression jjtn002 = new AstPostDecrementExpression(JJTPOSTDECREMENTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 1); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ ] } void CastExpression() : {/*@bgen(jjtree) CastExpression */ AstCastExpression jjtn000 = new AstCastExpression(JJTCASTEXPRESSION); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) CastExpression */ try { /*@egen*/ ( LOOKAHEAD( PrimitiveType()) Type() UnaryExpression() | Type() UnaryExpressionNotPlusMinus() )/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void PrimaryExpression() : {} { PrimaryPrefix() ( LOOKAHEAD(2) AllocationExpression() //unknown syntax | LOOKAHEAD(2) Expression()/*@bgen(jjtree) #ArrayReference( 2) */ { AstArrayReference jjtn001 = new AstArrayReference(JJTARRAYREFERENCE); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 2); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | LOOKAHEAD(3) /*@bgen(jjtree) #MethodInvocation( 2) */ { AstMethodInvocation jjtn002 = new AstMethodInvocation(JJTMETHODINVOCATION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ MethodCall()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ |/*@bgen(jjtree) #FieldReference( 2) */ { AstFieldReference jjtn003 = new AstFieldReference(JJTFIELDREFERENCE); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ Field()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ )* } void PrimaryPrefix() : {} { ( Literal() | Expression() | AllocationExpression() | LOOKAHEAD(ResultType() ) ResultType() | LOOKAHEAD(2) MethodCall() | LOOKAHEAD(3) Name() ) } void MethodCall() : {/*@bgen(jjtree) MethodCall */ AstMethodCall jjtn000 = new AstMethodCall(JJTMETHODCALL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) MethodCall */ try { /*@egen*/ { jjtn000._data= token.image; } Arguments()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void Field() : {/*@bgen(jjtree) Field */ AstField jjtn000 = new AstField(JJTFIELD); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) Field */ try { /*@egen*/ /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= token.image; }/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void Literal() : {/*@bgen(jjtree) Literal */ AstLiteral jjtn000 = new AstLiteral(JJTLITERAL); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) Literal */ try { /*@egen*/ ( /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Integer.valueOf(token.image); } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Float.valueOf(token.image); } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= new Character(token.image.charAt(1)); } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { String str = token.image; jjtn000._data = str; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { String str2 = token.image; jjtn000._data = str2; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Boolean.TRUE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= Boolean.FALSE; } | /*@bgen(jjtree)*/ { jjtree.closeNodeScope(jjtn000, true); jjtc000 = false; jjtreeCloseNodeScope(jjtn000); } /*@egen*/ { jjtn000._data= null; } )/*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void Arguments() : {/*@bgen(jjtree) Arguments */ AstArguments jjtn000 = new AstArguments(JJTARGUMENTS); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) Arguments */ try { /*@egen*/ [ ( LOOKAHEAD(2) NamedArgument() | Argument() ( ( LOOKAHEAD(2) NamedArguments() | Argument() ) )* )] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void Argument() : {} { LOOKAHEAD(2) NamedArgument() | Expression() } void NamedArguments() : {} { NamedArgument() ( NamedArgument() )* } void NamedArgument() : {/*@bgen(jjtree) NamedArgument */ AstNamedArgument jjtn000 = new AstNamedArgument(JJTNAMEDARGUMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) NamedArgument */ try { /*@egen*/ { jjtn000._data = token.image; } Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void AllocationExpression() : {} { LOOKAHEAD(2) PrimitiveType()/*@bgen(jjtree) #ArrayAllocationExpression( true) */ { AstArrayAllocationExpression jjtn001 = new AstArrayAllocationExpression(JJTARRAYALLOCATIONEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ ArrayDimsAndInits()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | Name() (/*@bgen(jjtree) #ArrayAllocationExpression( 2) */ { AstArrayAllocationExpression jjtn002 = new AstArrayAllocationExpression(JJTARRAYALLOCATIONEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ ArrayDimsAndInits()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 2); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ |/*@bgen(jjtree) #ObjectAllocationExpression( 2) */ { AstObjectAllocationExpression jjtn003 = new AstObjectAllocationExpression(JJTOBJECTALLOCATIONEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ Arguments()/*@bgen(jjtree)*/ } catch (Throwable jjte003) { if (jjtc003) { jjtree.clearNodeScope(jjtn003); jjtc003 = false; } else { jjtree.popNode(); } if (jjte003 instanceof RuntimeException) { throw (RuntimeException)jjte003; } if (jjte003 instanceof ParseException) { throw (ParseException)jjte003; } throw (Error)jjte003; } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 2); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ ) } /* * The second LOOKAHEAD specification below is to parse to PrimarySuffix * if there is an expression between the "[...]". */ void ArrayDimsAndInits() : {} { LOOKAHEAD(2)/*@bgen(jjtree) ArrayDims */ { AstArrayDims jjtn001 = new AstArrayDims(JJTARRAYDIMS); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ ( ( LOOKAHEAD(2) Expression() )+ ( LOOKAHEAD(2) )* )/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | ( )+ ArrayInitializer() } void LabeledStatement() : {/*@bgen(jjtree) LabeledStatement */ AstLabeledStatement jjtn000 = new AstLabeledStatement(JJTLABELEDSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) LabeledStatement */ try { /*@egen*/ { jjtn000._data= token.image; } JavaStatement()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void Block() : {/*@bgen(jjtree) Block */ AstBlock jjtn000 = new AstBlock(JJTBLOCK); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) Block */ try { /*@egen*/ ( JxpStatement() )* /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void EmptyStatement() : {/*@bgen(jjtree) EmptyStatement */ AstEmptyStatement jjtn000 = new AstEmptyStatement(JJTEMPTYSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) EmptyStatement */ try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void 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. */ {} { ( /*@bgen(jjtree) #PreIncrementExpression( true) */ { AstPreIncrementExpression jjtn001 = new AstPreIncrementExpression(JJTPREINCREMENTEXPRESSION); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ PrimaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, true); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ | /*@bgen(jjtree) #PreDecrementExpression( true) */ { AstPreDecrementExpression jjtn002 = new AstPreDecrementExpression(JJTPREDECREMENTEXPRESSION); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ PrimaryExpression()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, true); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ | PrimaryExpression() [/*@bgen(jjtree) #PostIncrementExpression( 1) */ { AstPostIncrementExpression jjtn003 = new AstPostIncrementExpression(JJTPOSTINCREMENTEXPRESSION); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003); jjtreeOpenNodeScope(jjtn003); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc003) { jjtree.closeNodeScope(jjtn003, 1); jjtreeCloseNodeScope(jjtn003); } } /*@egen*/ |/*@bgen(jjtree) #PostDecrementExpression( 1) */ { AstPostDecrementExpression jjtn004 = new AstPostDecrementExpression(JJTPOSTDECREMENTEXPRESSION); boolean jjtc004 = true; jjtree.openNodeScope(jjtn004); jjtreeOpenNodeScope(jjtn004); } try { /*@egen*/ /*@bgen(jjtree)*/ } finally { if (jjtc004) { jjtree.closeNodeScope(jjtn004, 1); jjtreeCloseNodeScope(jjtn004); } } /*@egen*/ | /*@bgen(jjtree) #AssignExpression( 2) */ { AstAssignExpression jjtn005 = new AstAssignExpression(JJTASSIGNEXPRESSION); boolean jjtc005 = true; jjtree.openNodeScope(jjtn005); jjtreeOpenNodeScope(jjtn005); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte005) { if (jjtc005) { jjtree.clearNodeScope(jjtn005); jjtc005 = false; } else { jjtree.popNode(); } if (jjte005 instanceof RuntimeException) { throw (RuntimeException)jjte005; } if (jjte005 instanceof ParseException) { throw (ParseException)jjte005; } throw (Error)jjte005; } finally { if (jjtc005) { jjtree.closeNodeScope(jjtn005, 2); jjtreeCloseNodeScope(jjtn005); } } /*@egen*/ | /*@bgen(jjtree) #MultiplyAssignExpression( 2) */ { AstMultiplyAssignExpression jjtn006 = new AstMultiplyAssignExpression(JJTMULTIPLYASSIGNEXPRESSION); boolean jjtc006 = true; jjtree.openNodeScope(jjtn006); jjtreeOpenNodeScope(jjtn006); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte006) { if (jjtc006) { jjtree.clearNodeScope(jjtn006); jjtc006 = false; } else { jjtree.popNode(); } if (jjte006 instanceof RuntimeException) { throw (RuntimeException)jjte006; } if (jjte006 instanceof ParseException) { throw (ParseException)jjte006; } throw (Error)jjte006; } finally { if (jjtc006) { jjtree.closeNodeScope(jjtn006, 2); jjtreeCloseNodeScope(jjtn006); } } /*@egen*/ | /*@bgen(jjtree) #DivideAssignExpression( 2) */ { AstDivideAssignExpression jjtn007 = new AstDivideAssignExpression(JJTDIVIDEASSIGNEXPRESSION); boolean jjtc007 = true; jjtree.openNodeScope(jjtn007); jjtreeOpenNodeScope(jjtn007); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte007) { if (jjtc007) { jjtree.clearNodeScope(jjtn007); jjtc007 = false; } else { jjtree.popNode(); } if (jjte007 instanceof RuntimeException) { throw (RuntimeException)jjte007; } if (jjte007 instanceof ParseException) { throw (ParseException)jjte007; } throw (Error)jjte007; } finally { if (jjtc007) { jjtree.closeNodeScope(jjtn007, 2); jjtreeCloseNodeScope(jjtn007); } } /*@egen*/ | /*@bgen(jjtree) #RemAssignExpression( 2) */ { AstRemAssignExpression jjtn008 = new AstRemAssignExpression(JJTREMASSIGNEXPRESSION); boolean jjtc008 = true; jjtree.openNodeScope(jjtn008); jjtreeOpenNodeScope(jjtn008); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte008) { if (jjtc008) { jjtree.clearNodeScope(jjtn008); jjtc008 = false; } else { jjtree.popNode(); } if (jjte008 instanceof RuntimeException) { throw (RuntimeException)jjte008; } if (jjte008 instanceof ParseException) { throw (ParseException)jjte008; } throw (Error)jjte008; } finally { if (jjtc008) { jjtree.closeNodeScope(jjtn008, 2); jjtreeCloseNodeScope(jjtn008); } } /*@egen*/ | /*@bgen(jjtree) #PlusAssignExpression( 2) */ { AstPlusAssignExpression jjtn009 = new AstPlusAssignExpression(JJTPLUSASSIGNEXPRESSION); boolean jjtc009 = true; jjtree.openNodeScope(jjtn009); jjtreeOpenNodeScope(jjtn009); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte009) { if (jjtc009) { jjtree.clearNodeScope(jjtn009); jjtc009 = false; } else { jjtree.popNode(); } if (jjte009 instanceof RuntimeException) { throw (RuntimeException)jjte009; } if (jjte009 instanceof ParseException) { throw (ParseException)jjte009; } throw (Error)jjte009; } finally { if (jjtc009) { jjtree.closeNodeScope(jjtn009, 2); jjtreeCloseNodeScope(jjtn009); } } /*@egen*/ | /*@bgen(jjtree) #MinusAssignExpression( 2) */ { AstMinusAssignExpression jjtn010 = new AstMinusAssignExpression(JJTMINUSASSIGNEXPRESSION); boolean jjtc010 = true; jjtree.openNodeScope(jjtn010); jjtreeOpenNodeScope(jjtn010); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte010) { if (jjtc010) { jjtree.clearNodeScope(jjtn010); jjtc010 = false; } else { jjtree.popNode(); } if (jjte010 instanceof RuntimeException) { throw (RuntimeException)jjte010; } if (jjte010 instanceof ParseException) { throw (ParseException)jjte010; } throw (Error)jjte010; } finally { if (jjtc010) { jjtree.closeNodeScope(jjtn010, 2); jjtreeCloseNodeScope(jjtn010); } } /*@egen*/ | /*@bgen(jjtree) #LShiftAssignExpression( 2) */ { AstLShiftAssignExpression jjtn011 = new AstLShiftAssignExpression(JJTLSHIFTASSIGNEXPRESSION); boolean jjtc011 = true; jjtree.openNodeScope(jjtn011); jjtreeOpenNodeScope(jjtn011); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte011) { if (jjtc011) { jjtree.clearNodeScope(jjtn011); jjtc011 = false; } else { jjtree.popNode(); } if (jjte011 instanceof RuntimeException) { throw (RuntimeException)jjte011; } if (jjte011 instanceof ParseException) { throw (ParseException)jjte011; } throw (Error)jjte011; } finally { if (jjtc011) { jjtree.closeNodeScope(jjtn011, 2); jjtreeCloseNodeScope(jjtn011); } } /*@egen*/ | /*@bgen(jjtree) #RSignedShiftAssignExpression( 2) */ { AstRSignedShiftAssignExpression jjtn012 = new AstRSignedShiftAssignExpression(JJTRSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc012 = true; jjtree.openNodeScope(jjtn012); jjtreeOpenNodeScope(jjtn012); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte012) { if (jjtc012) { jjtree.clearNodeScope(jjtn012); jjtc012 = false; } else { jjtree.popNode(); } if (jjte012 instanceof RuntimeException) { throw (RuntimeException)jjte012; } if (jjte012 instanceof ParseException) { throw (ParseException)jjte012; } throw (Error)jjte012; } finally { if (jjtc012) { jjtree.closeNodeScope(jjtn012, 2); jjtreeCloseNodeScope(jjtn012); } } /*@egen*/ | /*@bgen(jjtree) #RUnsignedShiftAssignExpression( 2) */ { AstRUnsignedShiftAssignExpression jjtn013 = new AstRUnsignedShiftAssignExpression(JJTRUNSIGNEDSHIFTASSIGNEXPRESSION); boolean jjtc013 = true; jjtree.openNodeScope(jjtn013); jjtreeOpenNodeScope(jjtn013); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte013) { if (jjtc013) { jjtree.clearNodeScope(jjtn013); jjtc013 = false; } else { jjtree.popNode(); } if (jjte013 instanceof RuntimeException) { throw (RuntimeException)jjte013; } if (jjte013 instanceof ParseException) { throw (ParseException)jjte013; } throw (Error)jjte013; } finally { if (jjtc013) { jjtree.closeNodeScope(jjtn013, 2); jjtreeCloseNodeScope(jjtn013); } } /*@egen*/ | /*@bgen(jjtree) #BitwiseAndAssignExpression( 2) */ { AstBitwiseAndAssignExpression jjtn014 = new AstBitwiseAndAssignExpression(JJTBITWISEANDASSIGNEXPRESSION); boolean jjtc014 = true; jjtree.openNodeScope(jjtn014); jjtreeOpenNodeScope(jjtn014); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte014) { if (jjtc014) { jjtree.clearNodeScope(jjtn014); jjtc014 = false; } else { jjtree.popNode(); } if (jjte014 instanceof RuntimeException) { throw (RuntimeException)jjte014; } if (jjte014 instanceof ParseException) { throw (ParseException)jjte014; } throw (Error)jjte014; } finally { if (jjtc014) { jjtree.closeNodeScope(jjtn014, 2); jjtreeCloseNodeScope(jjtn014); } } /*@egen*/ | /*@bgen(jjtree) #BitwiseXOrAssignExpression( 2) */ { AstBitwiseXOrAssignExpression jjtn015 = new AstBitwiseXOrAssignExpression(JJTBITWISEXORASSIGNEXPRESSION); boolean jjtc015 = true; jjtree.openNodeScope(jjtn015); jjtreeOpenNodeScope(jjtn015); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte015) { if (jjtc015) { jjtree.clearNodeScope(jjtn015); jjtc015 = false; } else { jjtree.popNode(); } if (jjte015 instanceof RuntimeException) { throw (RuntimeException)jjte015; } if (jjte015 instanceof ParseException) { throw (ParseException)jjte015; } throw (Error)jjte015; } finally { if (jjtc015) { jjtree.closeNodeScope(jjtn015, 2); jjtreeCloseNodeScope(jjtn015); } } /*@egen*/ | /*@bgen(jjtree) #BitwiseOrAssignExpression( 2) */ { AstBitwiseOrAssignExpression jjtn016 = new AstBitwiseOrAssignExpression(JJTBITWISEORASSIGNEXPRESSION); boolean jjtc016 = true; jjtree.openNodeScope(jjtn016); jjtreeOpenNodeScope(jjtn016); } try { /*@egen*/ Expression()/*@bgen(jjtree)*/ } catch (Throwable jjte016) { if (jjtc016) { jjtree.clearNodeScope(jjtn016); jjtc016 = false; } else { jjtree.popNode(); } if (jjte016 instanceof RuntimeException) { throw (RuntimeException)jjte016; } if (jjte016 instanceof ParseException) { throw (ParseException)jjte016; } throw (Error)jjte016; } finally { if (jjtc016) { jjtree.closeNodeScope(jjtn016, 2); jjtreeCloseNodeScope(jjtn016); } } /*@egen*/ ] ) } void SwitchStatement() : {/*@bgen(jjtree) SwitchStatement */ AstSwitchStatement jjtn000 = new AstSwitchStatement(JJTSWITCHSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) SwitchStatement */ try { /*@egen*/ Expression() ( Case() )* /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void Case() : {/*@bgen(jjtree) Case */ AstCase jjtn000 = new AstCase(JJTCASE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) Case */ try { /*@egen*/ SwitchLabel()/*@bgen(jjtree) #Block(> 1) */ { AstBlock jjtn001 = new AstBlock(JJTBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ ( JxpStatement() )*/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); jjtreeCloseNodeScope(jjtn001); } } /*@egen*//*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void SwitchLabel() : {} { Expression() //TODO: improve the grammar | <_DEFAULT> } void 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. */ {/*@bgen(jjtree) IfStatement */ AstIfStatement jjtn000 = new AstIfStatement(JJTIFSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) IfStatement */ try { /*@egen*/ Expression() JavaStatement() [ LOOKAHEAD(1) JavaStatement() ]/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void WhileStatement() : {/*@bgen(jjtree) WhileStatement */ AstWhileStatement jjtn000 = new AstWhileStatement(JJTWHILESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) WhileStatement */ try { /*@egen*/ Expression() JavaStatement()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void DoStatement() : {/*@bgen(jjtree) DoStatement */ AstDoStatement jjtn000 = new AstDoStatement(JJTDOSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) DoStatement */ try { /*@egen*/ JavaStatement() Expression() /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void EnhancedForStatement() : {/*@bgen(jjtree) EnhancedForStatement */ AstEnhancedForStatement jjtn000 = new AstEnhancedForStatement(JJTENHANCEDFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) EnhancedForStatement */ try { /*@egen*/ Type() { jjtn000._data = token.image; } Expression() JavaStatement()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ForStatement() : {/*@bgen(jjtree) ForStatement */ AstForStatement jjtn000 = new AstForStatement(JJTFORSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ForStatement */ try { /*@egen*/ [ ForInit() ] [ Expression() ] [ ForUpdate() ] JavaStatement()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ForInit() : {/*@bgen(jjtree) ForInit */ AstForInit jjtn000 = new AstForInit(JJTFORINIT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ForInit */ try { /*@egen*/ LOOKAHEAD(2) FieldDeclaration() | StatementExpressionList()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void StatementExpressionList() : {} { StatementExpression()/*@bgen(jjtree) #StatementExpressionList(> 1) */ { AstStatementExpressionList jjtn001 = new AstStatementExpressionList(JJTSTATEMENTEXPRESSIONLIST); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ ( "," StatementExpression() )*/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, jjtree.nodeArity() > 1); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ } void ForUpdate() : {/*@bgen(jjtree) ForUpdate */ AstForUpdate jjtn000 = new AstForUpdate(JJTFORUPDATE); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ForUpdate */ try { /*@egen*/ StatementExpressionList()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void BreakStatement() : {/*@bgen(jjtree) BreakStatement */ AstBreakStatement jjtn000 = new AstBreakStatement(JJTBREAKSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) BreakStatement */ try { /*@egen*/ [ { jjtn000._data= token.image; } ] /*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ContinueStatement() : {/*@bgen(jjtree) ContinueStatement */ AstContinueStatement jjtn000 = new AstContinueStatement(JJTCONTINUESTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ContinueStatement */ try { /*@egen*/ [ { jjtn000._data= token.image; } ] /*@bgen(jjtree)*/ } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ReturnStatement() : {/*@bgen(jjtree) ReturnStatement */ AstReturnStatement jjtn000 = new AstReturnStatement(JJTRETURNSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ReturnStatement */ try { /*@egen*/ [ Expression() ] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void ThrowStatement() : {/*@bgen(jjtree) ThrowStatement */ AstThrowStatement jjtn000 = new AstThrowStatement(JJTTHROWSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) ThrowStatement */ try { /*@egen*/ Expression() /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void SynchronizedStatement() : {/*@bgen(jjtree) SynchronizedStatement */ AstSynchronizedStatement jjtn000 = new AstSynchronizedStatement(JJTSYNCHRONIZEDSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) SynchronizedStatement */ try { /*@egen*/ Expression() Block()/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void TryStatement() : /* * Semantic check required here to make sure that at least one * finally/catch is present. */ {/*@bgen(jjtree) TryStatement */ AstTryStatement jjtn000 = new AstTryStatement(JJTTRYSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) TryStatement */ try { /*@egen*/ Block() ( Type() VariableDeclaratorId() /*@bgen(jjtree) #CatchBlock( 3) */ { AstCatchBlock jjtn001 = new AstCatchBlock(JJTCATCHBLOCK); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001); jjtreeOpenNodeScope(jjtn001); } try { /*@egen*/ Block()/*@bgen(jjtree)*/ } catch (Throwable jjte001) { if (jjtc001) { jjtree.clearNodeScope(jjtn001); jjtc001 = false; } else { jjtree.popNode(); } if (jjte001 instanceof RuntimeException) { throw (RuntimeException)jjte001; } if (jjte001 instanceof ParseException) { throw (ParseException)jjte001; } throw (Error)jjte001; } finally { if (jjtc001) { jjtree.closeNodeScope(jjtn001, 3); jjtreeCloseNodeScope(jjtn001); } } /*@egen*/ )* [ /*@bgen(jjtree) #FinallyBlock( 1) */ { AstFinallyBlock jjtn002 = new AstFinallyBlock(JJTFINALLYBLOCK); boolean jjtc002 = true; jjtree.openNodeScope(jjtn002); jjtreeOpenNodeScope(jjtn002); } try { /*@egen*/ Block()/*@bgen(jjtree)*/ } catch (Throwable jjte002) { if (jjtc002) { jjtree.clearNodeScope(jjtn002); jjtc002 = false; } else { jjtree.popNode(); } if (jjte002 instanceof RuntimeException) { throw (RuntimeException)jjte002; } if (jjte002 instanceof ParseException) { throw (ParseException)jjte002; } throw (Error)jjte002; } finally { if (jjtc002) { jjtree.closeNodeScope(jjtn002, 1); jjtreeCloseNodeScope(jjtn002); } } /*@egen*/ ]/*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } // added by Andrea Gini void AssertStatement() : {/*@bgen(jjtree) AssertStatement */ AstAssertStatement jjtn000 = new AstAssertStatement(JJTASSERTSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) AssertStatement */ try { /*@egen*/ Expression() [ Expression() ] /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } void PrintStatement() : {/*@bgen(jjtree) PrintStatement */ AstPrintStatement jjtn000 = new AstPrintStatement(JJTPRINTSTATEMENT); boolean jjtc000 = true; jjtree.openNodeScope(jjtn000); jjtreeOpenNodeScope(jjtn000); /*@egen*/} {/*@bgen(jjtree) PrintStatement */ try { /*@egen*/ Expression() /*@bgen(jjtree)*/ } catch (Throwable jjte000) { if (jjtc000) { jjtree.clearNodeScope(jjtn000); jjtc000 = false; } else { jjtree.popNode(); } if (jjte000 instanceof RuntimeException) { throw (RuntimeException)jjte000; } if (jjte000 instanceof ParseException) { throw (ParseException)jjte000; } throw (Error)jjte000; } finally { if (jjtc000) { jjtree.closeNodeScope(jjtn000, true); jjtreeCloseNodeScope(jjtn000); } } /*@egen*/ } jxp-1.6.1/src/java/org/onemind/jxp/parser/JxpParser.jjt100644 0 0 74631 10530435352 20156 0ustar 0 0 /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is JavaCC. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1996-2002 Sun * Microsystems, Inc. All Rights Reserved. */ /* * Altered by Tiong Lee (thlee@onemindsoft.org) extensive to be a JJTree grammar */ options { /** JJTree options **/ BUILD_NODE_FILES= true; // Generate sample implementations for SimpleNode and any other nodes used in the grammar. MULTI= true; // Generate a multi mode parse tree. The default for this is false, generating a simple mode parse tree. NODE_DEFAULT_VOID= false; // Instead of making each non-decorated production an indefinite node, make it void instead. NODE_FACTORY= false; //Use a factory method with following signature to construct nodes: public static Node jjtCreate(int id) NODE_PACKAGE= "org.onemind.jxp.parser"; //The package to generate the node classes into. The default for this is the parser package. NODE_PREFIX= "Ast"; //The prefix used to construct node class names from node identifiers in multi mode. The default for this is AST. NODE_SCOPE_HOOK= true; //Insert calls to user-defined parser methods on entry and exit of every node scope. See Node Scope Hooks above. NODE_USES_PARSER= false; //JJTree will use an alternate form of the node construction routines where it passes the parser object in. For example, STATIC= false; //Static parser VISITOR= true; //Insert a jjtAccept() method in the node classes, and generate a visitor implementation with an entry for every node type used in the grammar. VISITOR_EXCEPTION= "Exception"; //If this option is set, it is used in the signature of the generated jjtAccept() methods and the visit() methods. Note: this option will be removed in a later version of JJTree. Don't use it if that bothers you. LOOKAHEAD= 1; CHOICE_AMBIGUITY_CHECK= 2; OTHER_AMBIGUITY_CHECK= 1; DEBUG_PARSER= false; DEBUG_LOOKAHEAD= false; DEBUG_TOKEN_MANAGER= false; ERROR_REPORTING= true; JAVA_UNICODE_ESCAPE= true; UNICODE_INPUT= false; IGNORE_CASE= false; USER_TOKEN_MANAGER= false; USER_CHAR_STREAM= false; BUILD_PARSER= true; BUILD_TOKEN_MANAGER= true; SANITY_CHECK= true; FORCE_LA_CHECK= false; } PARSER_BEGIN(JxpParser) /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.parser; import java.io.*; import java.util.*; import org.onemind.commons.java.lang.*; public class JxpParser { public static void main(String args[]) throws ParseException, IOException { System.out.println("Dumping structure for " + args[0]); JxpParser parser= new JxpParser(new FileInputStream(args[0])); AstJxpDocument doc= parser.JxpDocument(); doc.dump(""); } void jjtreeOpenNodeScope(Node n) { ((SimpleNode) n)._line= getToken(0).beginLine; ((SimpleNode) n)._col= getToken(0).beginColumn; } void jjtreeCloseNodeScope(Node n) {} static String normalizeStringLiteral(StringBuffer image, char quote){ String str = image.substring(1, image.length() - 1); //remove the quotes StringBuffer copy = new StringBuffer(); boolean escape = false; for (int i=0; i" : JAVA | "<%!!" : NO_PARSE } TOKEN : { | : JAVA | | : JXP | : JAVA | "> : JAVA | "> : JXP | : JXP } TOKEN : { " ])+> } /* WHITE SPACE */ SKIP : { " " | "\t" | "\n" | "\r" | "\f" | <"%>" ("\r" | "\n" |"\r\n")?> : DEFAULT | <"" ("\r" | "\n" |"\r\n")?> : DEFAULT } SKIP : { " " | "\t" | "\n" | "\r" | "\f" } TOKEN: { " ("\r" | "\n" |"\r\n")?> : DEFAULT | "> : DEFAULT | "> : DEFAULT | : DEFAULT } /* COMMENTS */ MORE : { "//" : IN_SINGLE_LINE_COMMENT | < "/**" ~[ "/" ]> { input_stream.backup(1); } : IN_FORMAL_COMMENT | "/*" : IN_MULTI_LINE_COMMENT } SKIP : { < "!!%>" > : DEFAULT } MORE: { "<%--" : IN_COMMENT } SPECIAL_TOKEN : { "--%>" : DEFAULT | "--%>\r" : DEFAULT | "--%>\n" : DEFAULT | "--%>\r\n" : DEFAULT } SPECIAL_TOKEN : { : JAVA } SPECIAL_TOKEN : { : JAVA } SPECIAL_TOKEN : { : JAVA } MORE : { < ~[ ]> } /* RESERVED WORDS AND LITERALS */ TOKEN : { < ABSTRACT : "abstract"> | < 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"> | < EXTENDS : "extends"> | < 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"> | < PACKAGE : "package"> | < PRIVATE : "private"> | < PROTECTED : "protected"> | < PUBLIC : "public"> | < RETURN : "return"> | < SHORT : "short"> | < STATIC : "static"> | < SUPER : "super"> | < SWITCH : "switch"> | < SYNCHRONIZED : "synchronized"> | < THIS : "this"> | < THROW : "throw"> | < THROWS : "throws"> | < TRANSIENT : "transient"> | < TRY : "try"> | < VOID : "void"> | < VOLATILE : "volatile"> | < WHILE : "while"> | < STRICTFP : "strictfp"> // added by Andrea Gini | < ASSERT : "assert"> | < VAR : "var"> | < FUNCTION: "function"> | < EXIT: "exit"> | } TOKEN : /** shared reserve word **/ { < NULL : "null"> | < TRUE : "true"> | < FALSE : "false"> } TOKEN : { < PAGE: "page"> | < INCLUDE: "include" > } TOKEN : /* expression language */ { < JSP_AND: "and" > | < JSP_EQ: "eq" > | < JSP_GT: "gt" > | < JSP_OR: "or" > | < JSP_NE: "me" > | < JSP_LE: "le" > | < JSP_EMPTY: "empty"> | < JSP_NOT: "not" > | < JSP_LT: "lt" > | < JSP_GE: "ge" > | < JSP_DIV: "div" > | < JSP_MOD: "mod" > } /* LITERALS */ TOKEN : { < INTEGER_LITERAL : ( [ "l", "L" ] )? | ( [ "l", "L" ] )? | ( [ "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" ] )* ( )? ( [ "f", "F", "d", "D" ] )? | "." ( [ "0"-"9" ] )+ ( )? ( [ "f", "F", "d", "D" ] )? | ( [ "0"-"9" ] )+ ( [ "f", "F", "d", "D" ] )? | ( [ "0"-"9" ] )+ ( )? [ "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" ] ) ) )* "\"" > { matchedToken.image = JxpParser.normalizeStringLiteral(image, '\"'); } } TOKEN : { /** jsp EL literal **/ < JSP_STRING_LITERAL : "\'" ( ( ~[ "\'", "\\", "\n", "\r" ] ) | ( "\\" ( [ "n", "t", "b", "r", "f", "\\", "'", "\"" ] | [ "0"-"7" ] ( [ "0"-"7" ] )? | [ "0"-"3" ] [ "0"-"7" ] [ "0"-"7" ] ) ) )* "\'" > { matchedToken.image = JxpParser.normalizeStringLiteral(image, '\''); } } /* IDENTIFIERS */ TOKEN : { < IDENTIFIER : ( | )*> | < #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 : { < LBRACE : "{"> | < RBRACE : "}"> } TOKEN : { < LPAREN : "("> | < RPAREN : ")"> | < LBRACKET : "["> | < RBRACKET : "]"> | < SEMICOLON : ";"> | < COMMA : ","> | < DOT : "."> | < BQ_OUT : "`"> : DEFAULT } /* OPERATORS */ TOKEN : { < ASSIGN : "="> | < GT : ">"> | < 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 : "<<"> | < RSIGNEDSHIFT : ">>"> | < RUNSIGNEDSHIFT : ">>>"> | < PLUSASSIGN : "+="> | < MINUSASSIGN : "-="> | < STARASSIGN : "*="> | < SLASHASSIGN : "/="> | < ANDASSIGN : "&="> | < ORASSIGN : "|="> | < XORASSIGN : "^="> | < REMASSIGN : "%="> | < LSHIFTASSIGN : "<<="> | < RSIGNEDSHIFTASSIGN : ">>="> | < RUNSIGNEDSHIFTASSIGN : ">>>="> } /***************************************** * THE SJI GRAMMER START HERE * *****************************************/ AstJxpDocument JxpDocument() : {} { ( JxpStatement() )* { return (AstJxpDocument) jjtThis; } } void JxpStatement() #void : {} { ( Content() | JavaStatement() | JspStatement() ) } void Content() : {} { { jjtThis._data= token.image; } | { jjtThis._data = "`"; } | { jjtThis._data = token.image; } } void JspStatement() #void : {} { JspDirective() | FieldDeclaration() { token_source.SwitchTo(JXP); } | FieldDeclaration() { token_source.SwitchTo(JXP); } | Expression() #PrintStatement(1) | Expression() #PrintStatement(1) | Expression() #PrintStatement(1) } void JspDirective() #void : {} { PageDirective() | IncludeDirective() } void PageDirective() : { Map attrs = new HashMap(); jjtThis._data = attrs; String id = null; } { ( { id = token.image; } { String str = token.image; attrs.put(id, str ); } )+ } void IncludeDirective() : { Map attrs = new HashMap(); jjtThis._data = attrs; String id = null; } { ( { id = token.image; } { String str = token.image; attrs.put(id, str ); } )+ } /***************************************** * Supported java grammer start here * *****************************************/ void JavaStatement() #void : {} { LOOKAHEAD(2) LabeledStatement() | LOOKAHEAD(2) StaticImportDeclaration() | ImportDeclaration() | LOOKAHEAD([] Type() ) FieldDeclaration() | Block() | EmptyStatement() | StatementExpression() | SwitchStatement() | IfStatement() | WhileStatement() | DoStatement() | LOOKAHEAD ( Type() ) EnhancedForStatement() | ForStatement() | BreakStatement() | ContinueStatement() | ReturnStatement() | ThrowStatement() | SynchronizedStatement() | TryStatement() // added by Andrea Gini | AssertStatement() | // LOOKAHEAD(MethodDeclarationLookahead() ) FunctionDeclaration() | PrintStatement() | ExitStatement() } void StaticImportDeclaration() : {} { Name() [ { jjtThis._data= token.image; } ] } void ImportDeclaration() : {} { Name() [ { jjtThis._data= token.image; } ] } /* // This production is to determine lookahead only. void MethodDeclarationLookahead() #void: {} { ( | | | | | | | | "strictfp" )? ResultType() "(" } */ void FieldDeclaration() : {} { [ { jjtThis._data = token.image; } ] Type() VariableDeclarator() ( VariableDeclarator() )* } void VariableDeclarator() : {} { VariableDeclaratorId() [ VariableInitializer() ] } void VariableDeclaratorId() : { AstVariableDeclaratorId idNode = (AstVariableDeclaratorId)jjtThis; } { { jjtThis._data = token.image; } ( { idNode._dim++; } )* } void VariableInitializer() #void : {} { ( ArrayInitializer() | Expression() ) } void ArrayInitializer() : {} { [ VariableInitializer() ( LOOKAHEAD(2) VariableInitializer() )* ] [ ] } void ExitStatement() : {} { } void FunctionDeclaration() : {} { ResultType() FunctionDeclarator() [ "throws" NameList() ] ( Block() | ) } void FunctionDeclarator() : {} { { jjtThis._data = token.image; } ( LOOKAHEAD ( Type() ) VariableParameters() | FormalParameters() ) ( )* } void VariableParameters() : {} { [ Type() { jjtThis._data = token.image; } ] } void FormalParameters() : {} { [ FormalParameter() ( FormalParameter() )* ] } void FormalParameter() : { } { [ ] Type() VariableDeclaratorId() [ Expression() ] } /* * Type, name and expression syntax follows. */ void Type() : { AstType typeNode = (AstType)jjtThis; } { ( PrimitiveType() | Name() ) ( { typeNode._dim++; } )* } void PrimitiveType() : {} { ( { jjtThis._data= Boolean.TYPE; } | { jjtThis._data= Character.TYPE; } | { jjtThis._data= Byte.TYPE; } | { jjtThis._data= Short.TYPE; } | { jjtThis._data= Integer.TYPE; } | { jjtThis._data= Long.TYPE; } | { jjtThis._data= Float.TYPE; } | { jjtThis._data= Double.TYPE; } | { jjtThis._data= Object.class; } ) } void ResultType() #void : {} { | Type() } void Name() : /* * A lookahead of 2 is required below since "Name" can be followed * by a ".*" when used in the context of an "ImportDeclaration". */ { List l= new ArrayList(); } { { l.add(token.image); } ( LOOKAHEAD( , { getToken(3).kind != LPAREN }) { l.add(token.image); } )* [ LOOKAHEAD( Name() ) Type() ] { jjtThis._data= l; } } void NameList() : {} { Name() ( "," Name() )* } /* * Expression syntax follows. */ void Expression() #void : /* * 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. */ { } { ( ConditionalExpression() [ LOOKAHEAD( 1, { getToken(1).specialToken == null } ) ( Expression() #AssignExpression(2) | Expression() #MultiplyAssignExpression(2) | Expression() #DivideAssignExpression(2) | Expression() #RemAssignExpression(2) | Expression() #PlusAssignExpression(2) | Expression() #MinusAssignExpression(2) | Expression() #LShiftAssignExpression(2) | Expression() #RSignedShiftAssignExpression(2) | Expression() #RUnsignedShiftAssignExpression(2) | Expression() #BitwiseAndAssignExpression(2) | Expression() #BitwiseXOrAssignExpression(2) | Expression() #BitwiseOrAssignExpression(2) ) ] ) } void ConditionalExpression() #void : {} { ( ConditionalOrExpression() [ Expression() ConditionalExpression() #HookExpression(3) ] ) } void ConditionalOrExpression() #void : {} { ConditionalAndExpression() ( ( | ) ConditionalAndExpression() #ConditionalOrExpression(2) )* } void ConditionalAndExpression() #void : {} { BitwiseOrExpression() ( (|) BitwiseOrExpression() #ConditionalAndExpression(2) )* } void BitwiseOrExpression() #void : {} { BitwiseXOrExpression() ( BitwiseXOrExpression() #BitwiseOrExpression(2) )* } void BitwiseXOrExpression() #void : {} { BitwiseAndExpression() ( BitwiseAndExpression() #BitwiseXOrExpression(2) )* } void BitwiseAndExpression() #void : {} { EqualityExpression() ( EqualityExpression() #BitwiseAndExpression(2) )* } void EqualityExpression() #void : {} { InstanceOfExpression() ( ( | ) InstanceOfExpression() #EQExpression(2) | ( | ) InstanceOfExpression() #NEExpression(2) )* } void InstanceOfExpression() #void : {} { RelationalExpression() [ Type() #InstanceOfExpression(2) ] } void RelationalExpression() #void : {} { ShiftExpression() ( ( | ) ShiftExpression() #LTExpression(2) | ( | ) ShiftExpression() #GTExpression(2) | ( | ) ShiftExpression() #LEExpression(2) | ( | ) ShiftExpression() #GEExpression(2) )* } void ShiftExpression() #void : {} { AdditiveExpression() ( AdditiveExpression() #LShiftExpression(2) | AdditiveExpression() #RSignedShiftExpression(2) | AdditiveExpression() #RUnsignedShiftExpression(2) )* } void AdditiveExpression() #void : {} { MultiplicativeExpression() ( MultiplicativeExpression() #PlusExpression(2) | MultiplicativeExpression() #MinusExpression(2) )* } void MultiplicativeExpression() #void : {} { UnaryExpression() ( UnaryExpression() #MultiplyExpression(2) | ( | ) UnaryExpression() #DivideExpression(2) | ( | ) UnaryExpression() #RemainderExpression(2) )* } void UnaryExpression() #void : {} { ( UnaryExpression() #UnaryPlusExpression(true) | UnaryExpression() #UnaryMinusExpression(true) | PrimaryExpression() #PreIncrementExpression(true) | PrimaryExpression() #PreDecrementExpression(true) | UnaryExpressionNotPlusMinus() ) } void UnaryExpressionNotPlusMinus() #void : {} { ( UnaryExpression() #BitwiseComplementExpression(true) | ( | ) UnaryExpression() #LogicalComplementExpression(true) | UnaryExpression() #IsEmptyExpression(true) | LOOKAHEAD(CastLookahead() ) CastExpression() | PostfixExpression() ) } // 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() #void : {} { LOOKAHEAD(2) PrimitiveType() | LOOKAHEAD( Name() ) Name() | Name() ( | | | | | | | Literal() ) } void PostfixExpression() #void : {} { PrimaryExpression() [ #PostIncrementExpression(1) | #PostDecrementExpression(1) ] } void CastExpression() : {} { ( LOOKAHEAD( PrimitiveType()) Type() UnaryExpression() | Type() UnaryExpressionNotPlusMinus() ) } void PrimaryExpression() #void : {} { PrimaryPrefix() ( LOOKAHEAD(2) AllocationExpression() //unknown syntax | LOOKAHEAD(2) Expression() #ArrayReference(2) | LOOKAHEAD(3) MethodCall() #MethodInvocation(2) | Field() #FieldReference(2) )* } void PrimaryPrefix() #void : {} { ( Literal() | Expression() | AllocationExpression() | LOOKAHEAD(ResultType() ) ResultType() | LOOKAHEAD(2) MethodCall() | LOOKAHEAD(3) Name() ) } void MethodCall() : {} { { jjtThis._data= token.image; } Arguments() } void Field() : {} { { jjtThis._data= token.image; } } void Literal() : {} { ( { jjtThis._data= Integer.valueOf(token.image); } | { jjtThis._data= Float.valueOf(token.image); } | { jjtThis._data= new Character(token.image.charAt(1)); } | { String str = token.image; jjtThis._data = str; } | { String str2 = token.image; jjtThis._data = str2; } | { jjtThis._data= Boolean.TRUE; } | { jjtThis._data= Boolean.FALSE; } | { jjtThis._data= null; } ) } void Arguments() : {} { [ ( LOOKAHEAD(2) NamedArgument() | Argument() ( ( LOOKAHEAD(2) NamedArguments() | Argument() ) )* )] } void Argument() #void : {} { LOOKAHEAD(2) NamedArgument() | Expression() } void NamedArguments() #void: {} { NamedArgument() ( NamedArgument() )* } void NamedArgument() : {} { { jjtThis._data = token.image; } Expression() } void AllocationExpression() #void : {} { LOOKAHEAD(2) PrimitiveType() ArrayDimsAndInits() #ArrayAllocationExpression(true) | Name() ( ArrayDimsAndInits() #ArrayAllocationExpression(2) | Arguments() #ObjectAllocationExpression(2) ) } /* * The second LOOKAHEAD specification below is to parse to PrimarySuffix * if there is an expression between the "[...]". */ void ArrayDimsAndInits() #void : {} { LOOKAHEAD(2) ( ( LOOKAHEAD(2) Expression() )+ ( LOOKAHEAD(2) )* ) #ArrayDims | ( )+ ArrayInitializer() } void LabeledStatement() : {} { { jjtThis._data= token.image; } JavaStatement() } void Block() : {} { ( JxpStatement() )* } void EmptyStatement() : {} { } void StatementExpression() #void : /* * The last expansion of this production accepts more than the legal * Java expansions for StatementExpression. This expansion does not * use PostfixExpression for performance reasons. */ {} { ( PrimaryExpression() #PreIncrementExpression(true) | PrimaryExpression() #PreDecrementExpression(true) | PrimaryExpression() [ #PostIncrementExpression(1) | #PostDecrementExpression(1) | Expression() #AssignExpression(2) | Expression() #MultiplyAssignExpression(2) | Expression() #DivideAssignExpression(2) | Expression() #RemAssignExpression(2) | Expression() #PlusAssignExpression(2) | Expression() #MinusAssignExpression(2) | Expression() #LShiftAssignExpression(2) | Expression() #RSignedShiftAssignExpression(2) | Expression() #RUnsignedShiftAssignExpression(2) | Expression() #BitwiseAndAssignExpression(2) | Expression() #BitwiseXOrAssignExpression(2) | Expression() #BitwiseOrAssignExpression(2) ] ) } void SwitchStatement() : {} { Expression() ( Case() )* } void Case() : {} { SwitchLabel() ( JxpStatement() )* #Block(>1) } void SwitchLabel() #void : {} { Expression() //TODO: improve the grammar | <_DEFAULT> } void 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. */ {} { Expression() JavaStatement() [ LOOKAHEAD(1) JavaStatement() ] } void WhileStatement() : {} { Expression() JavaStatement() } void DoStatement() : {} { JavaStatement() Expression() } void EnhancedForStatement() : {} { Type() { jjtThis._data = token.image; } Expression() JavaStatement() } void ForStatement() : {} { [ ForInit() ] [ Expression() ] [ ForUpdate() ] JavaStatement() } void ForInit() : {} { LOOKAHEAD(2) FieldDeclaration() | StatementExpressionList() } void StatementExpressionList() #void : {} { StatementExpression() ( "," StatementExpression() )* #StatementExpressionList(>1) } void ForUpdate() : {} { StatementExpressionList() } void BreakStatement() : {} { [ { jjtThis._data= token.image; } ] } void ContinueStatement() : {} { [ { jjtThis._data= token.image; } ] } void ReturnStatement() : {} { [ Expression() ] } void ThrowStatement() : {} { Expression() } void SynchronizedStatement() : {} { Expression() Block() } void TryStatement() : /* * Semantic check required here to make sure that at least one * finally/catch is present. */ {} { Block() ( Type() VariableDeclaratorId() Block() #CatchBlock(3) )* [ Block() #FinallyBlock(1) ] } // added by Andrea Gini void AssertStatement() : {} { Expression() [ Expression() ] } void PrintStatement() : {} { Expression() } jxp-1.6.1/src/java/org/onemind/jxp/parser/JxpParserConstants.java100644 0 0 16635 10530435356 22211 0ustar 0 0 /* Generated By:JJTree&JavaCC: Do not edit this line. JxpParserConstants.java */ /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.parser; public interface JxpParserConstants { int EOF = 0; int CONTENT = 4; int BQ_IN = 5; int BQBQ = 6; int JSP_DIRECTIVE = 7; int JSP_DECLARATION = 8; int JSP_DECLARATION_TAG = 9; int JSP_EXPRESSION = 10; int JSP_EXPRESSION_TAG = 11; int JSP_EL = 12; int NO_PARSE_CONTENT = 13; int JSP_END_TAG = 26; int JSP_DECLARATION_TAG_END = 27; int JSP_EXPRESSION_TAG_END = 28; int JSP_END_EL = 29; int SINGLE_LINE_COMMENT = 39; int FORMAL_COMMENT = 40; int MULTI_LINE_COMMENT = 41; int ABSTRACT = 43; int BOOLEAN = 44; int BREAK = 45; int BYTE = 46; int CASE = 47; int CATCH = 48; int CHAR = 49; int CLASS = 50; int CONST = 51; int CONTINUE = 52; int _DEFAULT = 53; int DO = 54; int DOUBLE = 55; int ELSE = 56; int EXTENDS = 57; int FINAL = 58; int FINALLY = 59; int FLOAT = 60; int FOR = 61; int GOTO = 62; int IF = 63; int IMPLEMENTS = 64; int IMPORT = 65; int INSTANCEOF = 66; int INT = 67; int INTERFACE = 68; int LONG = 69; int NATIVE = 70; int NEW = 71; int PACKAGE = 72; int PRIVATE = 73; int PROTECTED = 74; int PUBLIC = 75; int RETURN = 76; int SHORT = 77; int STATIC = 78; int SUPER = 79; int SWITCH = 80; int SYNCHRONIZED = 81; int THIS = 82; int THROW = 83; int THROWS = 84; int TRANSIENT = 85; int TRY = 86; int VOID = 87; int VOLATILE = 88; int WHILE = 89; int STRICTFP = 90; int ASSERT = 91; int VAR = 92; int FUNCTION = 93; int EXIT = 94; int DOTDOTDOT = 95; int NULL = 96; int TRUE = 97; int FALSE = 98; int PAGE = 99; int INCLUDE = 100; int JSP_AND = 101; int JSP_EQ = 102; int JSP_GT = 103; int JSP_OR = 104; int JSP_NE = 105; int JSP_LE = 106; int JSP_EMPTY = 107; int JSP_NOT = 108; int JSP_LT = 109; int JSP_GE = 110; int JSP_DIV = 111; int JSP_MOD = 112; int INTEGER_LITERAL = 113; int DECIMAL_LITERAL = 114; int HEX_LITERAL = 115; int OCTAL_LITERAL = 116; int FLOATING_POINT_LITERAL = 117; int EXPONENT = 118; int CHARACTER_LITERAL = 119; int STRING_LITERAL = 120; int JSP_STRING_LITERAL = 121; int IDENTIFIER = 122; int LETTER = 123; int DIGIT = 124; int LBRACE = 125; int RBRACE = 126; int LPAREN = 127; int RPAREN = 128; int LBRACKET = 129; int RBRACKET = 130; int SEMICOLON = 131; int COMMA = 132; int DOT = 133; int BQ_OUT = 134; int ASSIGN = 135; int GT = 136; int LT = 137; int BANG = 138; int TILDE = 139; int HOOK = 140; int COLON = 141; int EQ = 142; int LE = 143; int GE = 144; int NE = 145; int SC_OR = 146; int SC_AND = 147; int INCR = 148; int DECR = 149; int PLUS = 150; int MINUS = 151; int STAR = 152; int SLASH = 153; int BIT_AND = 154; int BIT_OR = 155; int XOR = 156; int REM = 157; int LSHIFT = 158; int RSIGNEDSHIFT = 159; int RUNSIGNEDSHIFT = 160; int PLUSASSIGN = 161; int MINUSASSIGN = 162; int STARASSIGN = 163; int SLASHASSIGN = 164; int ANDASSIGN = 165; int ORASSIGN = 166; int XORASSIGN = 167; int REMASSIGN = 168; int LSHIFTASSIGN = 169; int RSIGNEDSHIFTASSIGN = 170; int RUNSIGNEDSHIFTASSIGN = 171; int DEFAULT = 0; int NO_PARSE = 1; int JAVA = 2; int JXP = 3; int IN_COMMENT = 4; int IN_SINGLE_LINE_COMMENT = 5; int IN_FORMAL_COMMENT = 6; int IN_MULTI_LINE_COMMENT = 7; String[] tokenImage = { "", "\"<%\"", "\"\"", "\"<%!!\"", "", "\"`\"", "\"``\"", "\"<%@\"", "\"<%!\"", "\"\"", "\"<%=\"", "\"\"", "\"${\"", "", "\" \"", "\"\\t\"", "\"\\n\"", "\"\\r\"", "\"\\f\"", "", "", "\" \"", "\"\\t\"", "\"\\n\"", "\"\\r\"", "\"\\f\"", "", "\"\"", "\"\"", "\"}\"", "\"//\"", "", "\"/*\"", "\"!!%>\"", "\"<%--\"", "\"--%>\"", "\"--%>\\r\"", "\"--%>\\n\"", "\"--%>\\r\\n\"", "", "\"*/\"", "\"*/\"", "", "\"abstract\"", "\"boolean\"", "\"break\"", "\"byte\"", "\"case\"", "\"catch\"", "\"char\"", "\"class\"", "\"const\"", "\"continue\"", "\"default\"", "\"do\"", "\"double\"", "\"else\"", "\"extends\"", "\"final\"", "\"finally\"", "\"float\"", "\"for\"", "\"goto\"", "\"if\"", "\"implements\"", "\"import\"", "\"instanceof\"", "\"int\"", "\"interface\"", "\"long\"", "\"native\"", "\"new\"", "\"package\"", "\"private\"", "\"protected\"", "\"public\"", "\"return\"", "\"short\"", "\"static\"", "\"super\"", "\"switch\"", "\"synchronized\"", "\"this\"", "\"throw\"", "\"throws\"", "\"transient\"", "\"try\"", "\"void\"", "\"volatile\"", "\"while\"", "\"strictfp\"", "\"assert\"", "\"var\"", "\"function\"", "\"exit\"", "\"...\"", "\"null\"", "\"true\"", "\"false\"", "\"page\"", "\"include\"", "\"and\"", "\"eq\"", "\"gt\"", "\"or\"", "\"me\"", "\"le\"", "\"empty\"", "\"not\"", "\"lt\"", "\"ge\"", "\"div\"", "\"mod\"", "", "", "", "", "", "", "", "", "", "", "", "", "\"{\"", "\"}\"", "\"(\"", "\")\"", "\"[\"", "\"]\"", "\";\"", "\",\"", "\".\"", "\"`\"", "\"=\"", "\">\"", "\"<\"", "\"!\"", "\"~\"", "\"?\"", "\":\"", "\"==\"", "\"<=\"", "\">=\"", "\"!=\"", "\"||\"", "\"&&\"", "\"++\"", "\"--\"", "\"+\"", "\"-\"", "\"*\"", "\"/\"", "\"&\"", "\"|\"", "\"^\"", "\"%\"", "\"<<\"", "\">>\"", "\">>>\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"/=\"", "\"&=\"", "\"|=\"", "\"^=\"", "\"%=\"", "\"<<=\"", "\">>=\"", "\">>>=\"", "\"throws\"", "\",\"", }; } jxp-1.6.1/src/java/org/onemind/jxp/parser/JxpParserTokenManager.java100644 0 0 405527 10530435353 22627 0ustar 0 0 /* Generated By:JJTree&JavaCC: Do not edit this line. JxpParserTokenManager.java */ /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.parser; import java.io.*; import java.util.*; import org.onemind.commons.java.lang.*; public class JxpParserTokenManager implements JxpParserConstants { public java.io.PrintStream debugStream = System.out; public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } private final int jjStopStringLiteralDfa_1(int pos, long active0) { switch (pos) { case 0: if ((active0 & 0x200000000L) != 0L) return 4; return -1; case 1: if ((active0 & 0x200000000L) != 0L) return 5; return -1; case 2: if ((active0 & 0x200000000L) != 0L) return 7; return -1; default : return -1; } } private final int jjStartNfa_1(int pos, long active0) { return jjMoveNfa_1(jjStopStringLiteralDfa_1(pos, active0), pos + 1); } private final int jjStopAtPos(int pos, int kind) { jjmatchedKind = kind; jjmatchedPos = pos; return pos + 1; } private final int jjStartNfaWithStates_1(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_1(state, pos + 1); } private final int jjMoveStringLiteralDfa0_1() { switch(curChar) { case 33: return jjMoveStringLiteralDfa1_1(0x200000000L); default : return jjMoveNfa_1(9, 0); } } private final int jjMoveStringLiteralDfa1_1(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(0, active0); return 1; } switch(curChar) { case 33: return jjMoveStringLiteralDfa2_1(active0, 0x200000000L); default : break; } return jjStartNfa_1(0, active0); } private final int jjMoveStringLiteralDfa2_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(0, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(1, active0); return 2; } switch(curChar) { case 37: return jjMoveStringLiteralDfa3_1(active0, 0x200000000L); default : break; } return jjStartNfa_1(1, active0); } private final int jjMoveStringLiteralDfa3_1(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_1(1, old0); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_1(2, active0); return 3; } switch(curChar) { case 62: if ((active0 & 0x200000000L) != 0L) return jjStopAtPos(3, 33); break; default : break; } return jjStartNfa_1(2, active0); } private final void jjCheckNAdd(int state) { if (jjrounds[state] != jjround) { jjstateSet[jjnewStateCnt++] = state; jjrounds[state] = jjround; } } private final void jjAddStates(int start, int end) { do { jjstateSet[jjnewStateCnt++] = jjnextStates[start]; } while (start++ != end); } private final void jjCheckNAddTwoStates(int state1, int state2) { jjCheckNAdd(state1); jjCheckNAdd(state2); } private final void jjCheckNAddStates(int start, int end) { do { jjCheckNAdd(jjnextStates[start]); } while (start++ != end); } private final void jjCheckNAddStates(int start) { jjCheckNAdd(jjnextStates[start]); jjCheckNAdd(jjnextStates[start + 1]); } static final long[] jjbitVec0 = { 0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL }; static final long[] jjbitVec2 = { 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL }; private final int jjMoveNfa_1(int startState, int curPos) { int[] nextStates; int startsAt = 0; jjnewStateCnt = 9; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 9: if ((0xfffffffdffffffffL & l) != 0L) { if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); } else if (curChar == 33) jjAddStates(3, 4); if (curChar == 13) jjstateSet[jjnewStateCnt++] = 1; break; case 5: if ((0xffffffdfffffffffL & l) != 0L) { if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); } else if (curChar == 37) jjstateSet[jjnewStateCnt++] = 7; break; case 4: if (curChar == 33) jjstateSet[jjnewStateCnt++] = 6; if (curChar == 33) jjstateSet[jjnewStateCnt++] = 5; break; case 0: if ((0xfffffffdffffffffL & l) == 0L) break; if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); break; case 1: if (curChar != 10) break; if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); break; case 2: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 1; break; case 3: if (curChar == 33) jjAddStates(3, 4); break; case 6: if (curChar == 37) jjstateSet[jjnewStateCnt++] = 7; break; case 7: if ((0xbfffffffffffffffL & l) == 0L) break; if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); break; case 8: if (curChar == 33) jjstateSet[jjnewStateCnt++] = 6; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 9: case 0: case 7: if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); break; case 5: if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); 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); MatchLoop: do { switch(jjstateSet[--i]) { case 9: case 0: case 7: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); break; case 5: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 13) kind = 13; jjCheckNAddStates(0, 2); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 9 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } private final int jjMoveStringLiteralDfa0_0() { switch(curChar) { case 36: return jjMoveStringLiteralDfa1_0(0x1000L, 0x0L); case 44: jjmatchedKind = 173; return jjMoveNfa_0(0, 0); case 60: return jjMoveStringLiteralDfa1_0(0x400000f8eL, 0x0L); case 96: jjmatchedKind = 5; return jjMoveStringLiteralDfa1_0(0x40L, 0x0L); case 116: return jjMoveStringLiteralDfa1_0(0x0L, 0x100000000000L); default : return jjMoveNfa_0(0, 0); } } private final int jjMoveStringLiteralDfa1_0(long active0, long active2) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 0); } switch(curChar) { case 37: if ((active0 & 0x2L) != 0L) { jjmatchedKind = 1; jjmatchedPos = 1; } return jjMoveStringLiteralDfa2_0(active0, 0x400000588L, active2, 0L); case 74: return jjMoveStringLiteralDfa2_0(active0, 0x4L, active2, 0L); case 96: if ((active0 & 0x40L) != 0L) { jjmatchedKind = 6; jjmatchedPos = 1; } break; case 104: return jjMoveStringLiteralDfa2_0(active0, 0L, active2, 0x100000000000L); case 106: return jjMoveStringLiteralDfa2_0(active0, 0xa04L, active2, 0L); case 123: if ((active0 & 0x1000L) != 0L) { jjmatchedKind = 12; jjmatchedPos = 1; } break; default : break; } return jjMoveNfa_0(0, 1); } private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old2, long active2) { if (((active0 &= old0) | (active2 &= old2)) == 0L) return jjMoveNfa_0(0, 1); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 1); } switch(curChar) { case 33: if ((active0 & 0x100L) != 0L) { jjmatchedKind = 8; jjmatchedPos = 2; } return jjMoveStringLiteralDfa3_0(active0, 0x8L, active2, 0L); case 45: return jjMoveStringLiteralDfa3_0(active0, 0x400000000L, active2, 0L); case 61: if ((active0 & 0x400L) != 0L) { jjmatchedKind = 10; jjmatchedPos = 2; } break; case 64: if ((active0 & 0x80L) != 0L) { jjmatchedKind = 7; jjmatchedPos = 2; } break; case 83: return jjMoveStringLiteralDfa3_0(active0, 0x4L, active2, 0L); case 114: return jjMoveStringLiteralDfa3_0(active0, 0L, active2, 0x100000000000L); case 115: return jjMoveStringLiteralDfa3_0(active0, 0xa04L, active2, 0L); default : break; } return jjMoveNfa_0(0, 2); } private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old2, long active2) { if (((active0 &= old0) | (active2 &= old2)) == 0L) return jjMoveNfa_0(0, 2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 2); } switch(curChar) { case 33: if ((active0 & 0x8L) != 0L) { jjmatchedKind = 3; jjmatchedPos = 3; } break; case 45: if ((active0 & 0x400000000L) != 0L) { jjmatchedKind = 34; jjmatchedPos = 3; } break; case 80: return jjMoveStringLiteralDfa4_0(active0, 0x4L, active2, 0L); case 111: return jjMoveStringLiteralDfa4_0(active0, 0L, active2, 0x100000000000L); case 112: return jjMoveStringLiteralDfa4_0(active0, 0xa04L, active2, 0L); default : break; } return jjMoveNfa_0(0, 3); } private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old2, long active2) { if (((active0 &= old0) | (active2 &= old2)) == 0L) return jjMoveNfa_0(0, 3); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 3); } switch(curChar) { case 58: return jjMoveStringLiteralDfa5_0(active0, 0xa04L, active2, 0L); case 119: return jjMoveStringLiteralDfa5_0(active0, 0L, active2, 0x100000000000L); default : break; } return jjMoveNfa_0(0, 4); } private final int jjMoveStringLiteralDfa5_0(long old0, long active0, long old2, long active2) { if (((active0 &= old0) | (active2 &= old2)) == 0L) return jjMoveNfa_0(0, 4); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 4); } switch(curChar) { case 83: return jjMoveStringLiteralDfa6_0(active0, 0x4L, active2, 0L); case 100: return jjMoveStringLiteralDfa6_0(active0, 0x200L, active2, 0L); case 101: return jjMoveStringLiteralDfa6_0(active0, 0x800L, active2, 0L); case 115: if ((active2 & 0x100000000000L) != 0L) { jjmatchedKind = 172; jjmatchedPos = 5; } return jjMoveStringLiteralDfa6_0(active0, 0x4L, active2, 0L); default : break; } return jjMoveNfa_0(0, 5); } private final int jjMoveStringLiteralDfa6_0(long old0, long active0, long old2, long active2) { if (((active0 &= old0) | (active2 &= old2)) == 0L) return jjMoveNfa_0(0, 5); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 5); } switch(curChar) { case 67: return jjMoveStringLiteralDfa7_0(active0, 0x4L); case 99: return jjMoveStringLiteralDfa7_0(active0, 0x4L); case 101: return jjMoveStringLiteralDfa7_0(active0, 0x200L); case 120: return jjMoveStringLiteralDfa7_0(active0, 0x800L); default : break; } return jjMoveNfa_0(0, 6); } private final int jjMoveStringLiteralDfa7_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 6); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 6); } switch(curChar) { case 82: return jjMoveStringLiteralDfa8_0(active0, 0x4L); case 99: return jjMoveStringLiteralDfa8_0(active0, 0x200L); case 112: return jjMoveStringLiteralDfa8_0(active0, 0x800L); case 114: return jjMoveStringLiteralDfa8_0(active0, 0x4L); default : break; } return jjMoveNfa_0(0, 7); } private final int jjMoveStringLiteralDfa8_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 7); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 7); } switch(curChar) { case 73: return jjMoveStringLiteralDfa9_0(active0, 0x4L); case 105: return jjMoveStringLiteralDfa9_0(active0, 0x4L); case 108: return jjMoveStringLiteralDfa9_0(active0, 0x200L); case 114: return jjMoveStringLiteralDfa9_0(active0, 0x800L); default : break; } return jjMoveNfa_0(0, 8); } private final int jjMoveStringLiteralDfa9_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 8); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 8); } switch(curChar) { case 80: return jjMoveStringLiteralDfa10_0(active0, 0x4L); case 97: return jjMoveStringLiteralDfa10_0(active0, 0x200L); case 101: return jjMoveStringLiteralDfa10_0(active0, 0x800L); case 112: return jjMoveStringLiteralDfa10_0(active0, 0x4L); default : break; } return jjMoveNfa_0(0, 9); } private final int jjMoveStringLiteralDfa10_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 9); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 9); } switch(curChar) { case 84: return jjMoveStringLiteralDfa11_0(active0, 0x4L); case 114: return jjMoveStringLiteralDfa11_0(active0, 0x200L); case 115: return jjMoveStringLiteralDfa11_0(active0, 0x800L); case 116: return jjMoveStringLiteralDfa11_0(active0, 0x4L); default : break; } return jjMoveNfa_0(0, 10); } private final int jjMoveStringLiteralDfa11_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 10); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 10); } switch(curChar) { case 76: return jjMoveStringLiteralDfa12_0(active0, 0x4L); case 97: return jjMoveStringLiteralDfa12_0(active0, 0x200L); case 108: return jjMoveStringLiteralDfa12_0(active0, 0x4L); case 115: return jjMoveStringLiteralDfa12_0(active0, 0x800L); default : break; } return jjMoveNfa_0(0, 11); } private final int jjMoveStringLiteralDfa12_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 11); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 11); } switch(curChar) { case 69: return jjMoveStringLiteralDfa13_0(active0, 0x4L); case 101: return jjMoveStringLiteralDfa13_0(active0, 0x4L); case 105: return jjMoveStringLiteralDfa13_0(active0, 0x800L); case 116: return jjMoveStringLiteralDfa13_0(active0, 0x200L); default : break; } return jjMoveNfa_0(0, 12); } private final int jjMoveStringLiteralDfa13_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 12); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 12); } switch(curChar) { case 84: return jjMoveStringLiteralDfa14_0(active0, 0x4L); case 105: return jjMoveStringLiteralDfa14_0(active0, 0x200L); case 111: return jjMoveStringLiteralDfa14_0(active0, 0x800L); case 116: return jjMoveStringLiteralDfa14_0(active0, 0x4L); default : break; } return jjMoveNfa_0(0, 13); } private final int jjMoveStringLiteralDfa14_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 13); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 13); } switch(curChar) { case 62: if ((active0 & 0x4L) != 0L) { jjmatchedKind = 2; jjmatchedPos = 14; } break; case 110: return jjMoveStringLiteralDfa15_0(active0, 0x800L); case 111: return jjMoveStringLiteralDfa15_0(active0, 0x200L); default : break; } return jjMoveNfa_0(0, 14); } private final int jjMoveStringLiteralDfa15_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 14); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 14); } switch(curChar) { case 62: if ((active0 & 0x800L) != 0L) { jjmatchedKind = 11; jjmatchedPos = 15; } break; case 110: return jjMoveStringLiteralDfa16_0(active0, 0x200L); default : break; } return jjMoveNfa_0(0, 15); } private final int jjMoveStringLiteralDfa16_0(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjMoveNfa_0(0, 15); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return jjMoveNfa_0(0, 15); } switch(curChar) { case 62: if ((active0 & 0x200L) != 0L) { jjmatchedKind = 9; jjmatchedPos = 16; } break; default : break; } return jjMoveNfa_0(0, 16); } private final int jjMoveNfa_0(int startState, int curPos) { int strKind = jjmatchedKind; int strPos = jjmatchedPos; int seenUpto; input_stream.backup(seenUpto = curPos + 1); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { throw new Error("Internal Error"); } curPos = 0; int[] nextStates; int startsAt = 0; jjnewStateCnt = 6; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 0: if ((0xefffffefffffffffL & l) != 0L) { if (kind > 4) kind = 4; jjCheckNAddStates(5, 7); } else if ((0x1000001000000000L & l) != 0L) { if (kind > 4) kind = 4; } if (curChar == 60) jjstateSet[jjnewStateCnt++] = 5; else if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 1: if ((0xefffffefffffffffL & l) == 0L) break; if (kind > 4) kind = 4; jjCheckNAddStates(5, 7); break; case 2: if (curChar != 10) break; if (kind > 4) kind = 4; jjCheckNAddStates(5, 7); break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 4: if (curChar == 60) jjstateSet[jjnewStateCnt++] = 5; break; case 5: if ((0xefffffcfffffffffL & l) == 0L) break; if (kind > 4) kind = 4; jjCheckNAddStates(5, 7); break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 0: case 1: if ((0xfffffffeffffffffL & l) == 0L) break; if (kind > 4) kind = 4; jjCheckNAddStates(5, 7); break; case 5: if ((0xfffffbfeffffffffL & l) == 0L) break; if (kind > 4) kind = 4; jjCheckNAddStates(5, 7); 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); MatchLoop: do { switch(jjstateSet[--i]) { case 0: case 1: case 5: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 4) kind = 4; jjCheckNAddStates(5, 7); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 6 - (jjnewStateCnt = startsAt))) break; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { break; } } if (jjmatchedPos > strPos) return curPos; int toRet = Math.max(curPos, seenUpto); if (curPos < toRet) for (i = toRet - Math.min(curPos, seenUpto); i-- > 0; ) try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { throw new Error("Internal Error : Please send a bug report."); } if (jjmatchedPos < strPos) { jjmatchedKind = strKind; jjmatchedPos = strPos; } else if (jjmatchedPos == strPos && jjmatchedKind > strKind) jjmatchedKind = strKind; return toRet; } private final int jjMoveStringLiteralDfa0_7() { switch(curChar) { case 42: return jjMoveStringLiteralDfa1_7(0x20000000000L); default : return 1; } } private final int jjMoveStringLiteralDfa1_7(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return 1; } switch(curChar) { case 47: if ((active0 & 0x20000000000L) != 0L) return jjStopAtPos(1, 41); break; default : return 2; } return 2; } private final int jjMoveStringLiteralDfa0_5() { return jjMoveNfa_5(0, 0); } private final int jjMoveNfa_5(int startState, int curPos) { int[] nextStates; int startsAt = 0; jjnewStateCnt = 3; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 0: if ((0x2400L & l) != 0L) { if (kind > 39) kind = 39; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 1; break; case 1: if (curChar == 10 && kind > 39) kind = 39; break; case 2: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 1; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: 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); MatchLoop: 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 final int jjMoveStringLiteralDfa0_6() { switch(curChar) { case 42: return jjMoveStringLiteralDfa1_6(0x10000000000L); default : return 1; } } private final int jjMoveStringLiteralDfa1_6(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return 1; } switch(curChar) { case 47: if ((active0 & 0x10000000000L) != 0L) return jjStopAtPos(1, 40); break; default : return 2; } return 2; } private final int jjStopStringLiteralDfa_3(int pos, long active0, long active1, long active2) { switch (pos) { case 0: if ((active2 & 0x10020000000L) != 0L) return 0; if ((active1 & 0x1ffff00000000L) != 0L) { jjmatchedKind = 122; return 24; } if ((active2 & 0x20L) != 0L) return 9; return -1; case 1: if ((active1 & 0x67c000000000L) != 0L) return 24; if ((active1 & 0x1983f00000000L) != 0L) { if (jjmatchedPos != 1) { jjmatchedKind = 122; jjmatchedPos = 1; } return 24; } return -1; case 2: if ((active1 & 0x1902000000000L) != 0L) return 24; if ((active1 & 0x81f00000000L) != 0L) { if (jjmatchedPos != 2) { jjmatchedKind = 122; jjmatchedPos = 2; } return 24; } return -1; case 3: if ((active1 & 0x81400000000L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 3; return 24; } if ((active1 & 0xb00000000L) != 0L) return 24; return -1; case 4: if ((active1 & 0x80400000000L) != 0L) return 24; if ((active1 & 0x1000000000L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 4; return 24; } return -1; case 5: if ((active1 & 0x1000000000L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 5; return 24; } return -1; case 6: if ((active1 & 0x1000000000L) != 0L) return 24; return -1; default : return -1; } } private final int jjStartNfa_3(int pos, long active0, long active1, long active2) { return jjMoveNfa_3(jjStopStringLiteralDfa_3(pos, active0, active1, active2), pos + 1); } private final int jjStartNfaWithStates_3(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_3(state, pos + 1); } private final int jjMoveStringLiteralDfa0_3() { switch(curChar) { case 33: jjmatchedKind = 138; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x20000L); case 37: jjmatchedKind = 157; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x10000000000L); case 38: jjmatchedKind = 154; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x2000080000L); case 40: return jjStopAtPos(0, 127); case 41: return jjStopAtPos(0, 128); case 42: jjmatchedKind = 152; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x800000000L); case 43: jjmatchedKind = 150; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x200100000L); case 44: return jjStopAtPos(0, 132); case 45: jjmatchedKind = 151; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x400200000L); case 46: return jjStartNfaWithStates_3(0, 133, 9); case 47: jjmatchedKind = 153; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x1000000000L); case 58: return jjStopAtPos(0, 141); case 59: return jjStopAtPos(0, 131); case 60: jjmatchedKind = 137; return jjMoveStringLiteralDfa1_3(0x18000000L, 0x0L, 0x20040008000L); case 61: jjmatchedKind = 135; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x4000L); case 62: jjmatchedKind = 136; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0xc0180010000L); case 63: return jjStopAtPos(0, 140); case 91: return jjStopAtPos(0, 129); case 93: return jjStopAtPos(0, 130); case 94: jjmatchedKind = 156; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x8000000000L); case 96: return jjStopAtPos(0, 134); case 97: return jjMoveStringLiteralDfa1_3(0x0L, 0x2000000000L, 0x0L); case 100: return jjMoveStringLiteralDfa1_3(0x0L, 0x800000000000L, 0x0L); case 101: return jjMoveStringLiteralDfa1_3(0x0L, 0x84000000000L, 0x0L); case 102: return jjMoveStringLiteralDfa1_3(0x0L, 0x400000000L, 0x0L); case 103: return jjMoveStringLiteralDfa1_3(0x0L, 0x408000000000L, 0x0L); case 105: return jjMoveStringLiteralDfa1_3(0x0L, 0x1000000000L, 0x0L); case 108: return jjMoveStringLiteralDfa1_3(0x0L, 0x240000000000L, 0x0L); case 109: return jjMoveStringLiteralDfa1_3(0x0L, 0x1020000000000L, 0x0L); case 110: return jjMoveStringLiteralDfa1_3(0x0L, 0x100100000000L, 0x0L); case 111: return jjMoveStringLiteralDfa1_3(0x0L, 0x10000000000L, 0x0L); case 112: return jjMoveStringLiteralDfa1_3(0x0L, 0x800000000L, 0x0L); case 116: return jjMoveStringLiteralDfa1_3(0x0L, 0x200000000L, 0x0L); case 124: jjmatchedKind = 155; return jjMoveStringLiteralDfa1_3(0x0L, 0x0L, 0x4000040000L); case 125: return jjStopAtPos(0, 29); case 126: return jjStopAtPos(0, 139); default : return jjMoveNfa_3(4, 0); } } private final int jjMoveStringLiteralDfa1_3(long active0, long active1, long active2) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(0, active0, active1, active2); return 1; } switch(curChar) { case 38: if ((active2 & 0x80000L) != 0L) return jjStopAtPos(1, 147); break; case 43: if ((active2 & 0x100000L) != 0L) return jjStopAtPos(1, 148); break; case 45: if ((active2 & 0x200000L) != 0L) return jjStopAtPos(1, 149); break; case 47: return jjMoveStringLiteralDfa2_3(active0, 0x18000000L, active1, 0L, active2, 0L); case 60: if ((active2 & 0x40000000L) != 0L) { jjmatchedKind = 158; jjmatchedPos = 1; } return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0L, active2, 0x20000000000L); case 61: if ((active2 & 0x4000L) != 0L) return jjStopAtPos(1, 142); else if ((active2 & 0x8000L) != 0L) return jjStopAtPos(1, 143); else if ((active2 & 0x10000L) != 0L) return jjStopAtPos(1, 144); else if ((active2 & 0x20000L) != 0L) return jjStopAtPos(1, 145); else if ((active2 & 0x200000000L) != 0L) return jjStopAtPos(1, 161); else if ((active2 & 0x400000000L) != 0L) return jjStopAtPos(1, 162); else if ((active2 & 0x800000000L) != 0L) return jjStopAtPos(1, 163); else if ((active2 & 0x1000000000L) != 0L) return jjStopAtPos(1, 164); else if ((active2 & 0x2000000000L) != 0L) return jjStopAtPos(1, 165); else if ((active2 & 0x4000000000L) != 0L) return jjStopAtPos(1, 166); else if ((active2 & 0x8000000000L) != 0L) return jjStopAtPos(1, 167); else if ((active2 & 0x10000000000L) != 0L) return jjStopAtPos(1, 168); break; case 62: if ((active2 & 0x80000000L) != 0L) { jjmatchedKind = 159; jjmatchedPos = 1; } return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0L, active2, 0xc0100000000L); case 97: return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0xc00000000L, active2, 0L); case 101: if ((active1 & 0x20000000000L) != 0L) return jjStartNfaWithStates_3(1, 105, 24); else if ((active1 & 0x40000000000L) != 0L) return jjStartNfaWithStates_3(1, 106, 24); else if ((active1 & 0x400000000000L) != 0L) return jjStartNfaWithStates_3(1, 110, 24); break; case 105: return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0x800000000000L, active2, 0L); case 109: return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0x80000000000L, active2, 0L); case 110: return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0x3000000000L, active2, 0L); case 111: return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0x1100000000000L, active2, 0L); case 113: if ((active1 & 0x4000000000L) != 0L) return jjStartNfaWithStates_3(1, 102, 24); break; case 114: if ((active1 & 0x10000000000L) != 0L) return jjStartNfaWithStates_3(1, 104, 24); return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0x200000000L, active2, 0L); case 116: if ((active1 & 0x8000000000L) != 0L) return jjStartNfaWithStates_3(1, 103, 24); else if ((active1 & 0x200000000000L) != 0L) return jjStartNfaWithStates_3(1, 109, 24); break; case 117: return jjMoveStringLiteralDfa2_3(active0, 0L, active1, 0x100000000L, active2, 0L); case 124: if ((active2 & 0x40000L) != 0L) return jjStopAtPos(1, 146); break; default : break; } return jjStartNfa_3(0, active0, active1, active2); } private final int jjMoveStringLiteralDfa2_3(long old0, long active0, long old1, long active1, long old2, long active2) { if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) return jjStartNfa_3(0, old0, old1, old2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(1, active0, active1, active2); return 2; } switch(curChar) { case 61: if ((active2 & 0x20000000000L) != 0L) return jjStopAtPos(2, 169); else if ((active2 & 0x40000000000L) != 0L) return jjStopAtPos(2, 170); break; case 62: if ((active2 & 0x100000000L) != 0L) { jjmatchedKind = 160; jjmatchedPos = 2; } return jjMoveStringLiteralDfa3_3(active0, 0L, active1, 0L, active2, 0x80000000000L); case 99: return jjMoveStringLiteralDfa3_3(active0, 0L, active1, 0x1000000000L, active2, 0L); case 100: if ((active1 & 0x2000000000L) != 0L) return jjStartNfaWithStates_3(2, 101, 24); else if ((active1 & 0x1000000000000L) != 0L) return jjStartNfaWithStates_3(2, 112, 24); break; case 103: return jjMoveStringLiteralDfa3_3(active0, 0L, active1, 0x800000000L, active2, 0L); case 106: return jjMoveStringLiteralDfa3_3(active0, 0x18000000L, active1, 0L, active2, 0L); case 108: return jjMoveStringLiteralDfa3_3(active0, 0L, active1, 0x500000000L, active2, 0L); case 112: return jjMoveStringLiteralDfa3_3(active0, 0L, active1, 0x80000000000L, active2, 0L); case 116: if ((active1 & 0x100000000000L) != 0L) return jjStartNfaWithStates_3(2, 108, 24); break; case 117: return jjMoveStringLiteralDfa3_3(active0, 0L, active1, 0x200000000L, active2, 0L); case 118: if ((active1 & 0x800000000000L) != 0L) return jjStartNfaWithStates_3(2, 111, 24); break; default : break; } return jjStartNfa_3(1, active0, active1, active2); } private final int jjMoveStringLiteralDfa3_3(long old0, long active0, long old1, long active1, long old2, long active2) { if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) return jjStartNfa_3(1, old0, old1, old2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(2, active0, active1, active2); return 3; } switch(curChar) { case 61: if ((active2 & 0x80000000000L) != 0L) return jjStopAtPos(3, 171); break; case 101: if ((active1 & 0x200000000L) != 0L) return jjStartNfaWithStates_3(3, 97, 24); else if ((active1 & 0x800000000L) != 0L) return jjStartNfaWithStates_3(3, 99, 24); break; case 108: if ((active1 & 0x100000000L) != 0L) return jjStartNfaWithStates_3(3, 96, 24); return jjMoveStringLiteralDfa4_3(active0, 0L, active1, 0x1000000000L, active2, 0L); case 115: return jjMoveStringLiteralDfa4_3(active0, 0x18000000L, active1, 0x400000000L, active2, 0L); case 116: return jjMoveStringLiteralDfa4_3(active0, 0L, active1, 0x80000000000L, active2, 0L); default : break; } return jjStartNfa_3(2, active0, active1, active2); } private final int jjMoveStringLiteralDfa4_3(long old0, long active0, long old1, long active1, long old2, long active2) { if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) return jjStartNfa_3(2, old0, old1, old2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(3, active0, active1, 0L); return 4; } switch(curChar) { case 101: if ((active1 & 0x400000000L) != 0L) return jjStartNfaWithStates_3(4, 98, 24); break; case 112: return jjMoveStringLiteralDfa5_3(active0, 0x18000000L, active1, 0L); case 117: return jjMoveStringLiteralDfa5_3(active0, 0L, active1, 0x1000000000L); case 121: if ((active1 & 0x80000000000L) != 0L) return jjStartNfaWithStates_3(4, 107, 24); break; default : break; } return jjStartNfa_3(3, active0, active1, 0L); } private final int jjMoveStringLiteralDfa5_3(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_3(3, old0, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(4, active0, active1, 0L); return 5; } switch(curChar) { case 58: return jjMoveStringLiteralDfa6_3(active0, 0x18000000L, active1, 0L); case 100: return jjMoveStringLiteralDfa6_3(active0, 0L, active1, 0x1000000000L); default : break; } return jjStartNfa_3(4, active0, active1, 0L); } private final int jjMoveStringLiteralDfa6_3(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_3(4, old0, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(5, active0, active1, 0L); return 6; } switch(curChar) { case 100: return jjMoveStringLiteralDfa7_3(active0, 0x8000000L, active1, 0L); case 101: if ((active1 & 0x1000000000L) != 0L) return jjStartNfaWithStates_3(6, 100, 24); return jjMoveStringLiteralDfa7_3(active0, 0x10000000L, active1, 0L); default : break; } return jjStartNfa_3(5, active0, active1, 0L); } private final int jjMoveStringLiteralDfa7_3(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_3(5, old0, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(6, active0, 0L, 0L); return 7; } switch(curChar) { case 101: return jjMoveStringLiteralDfa8_3(active0, 0x8000000L); case 120: return jjMoveStringLiteralDfa8_3(active0, 0x10000000L); default : break; } return jjStartNfa_3(6, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa8_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(6, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(7, active0, 0L, 0L); return 8; } switch(curChar) { case 99: return jjMoveStringLiteralDfa9_3(active0, 0x8000000L); case 112: return jjMoveStringLiteralDfa9_3(active0, 0x10000000L); default : break; } return jjStartNfa_3(7, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa9_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(7, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(8, active0, 0L, 0L); return 9; } switch(curChar) { case 108: return jjMoveStringLiteralDfa10_3(active0, 0x8000000L); case 114: return jjMoveStringLiteralDfa10_3(active0, 0x10000000L); default : break; } return jjStartNfa_3(8, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa10_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(8, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(9, active0, 0L, 0L); return 10; } switch(curChar) { case 97: return jjMoveStringLiteralDfa11_3(active0, 0x8000000L); case 101: return jjMoveStringLiteralDfa11_3(active0, 0x10000000L); default : break; } return jjStartNfa_3(9, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa11_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(9, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(10, active0, 0L, 0L); return 11; } switch(curChar) { case 114: return jjMoveStringLiteralDfa12_3(active0, 0x8000000L); case 115: return jjMoveStringLiteralDfa12_3(active0, 0x10000000L); default : break; } return jjStartNfa_3(10, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa12_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(10, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(11, active0, 0L, 0L); return 12; } switch(curChar) { case 97: return jjMoveStringLiteralDfa13_3(active0, 0x8000000L); case 115: return jjMoveStringLiteralDfa13_3(active0, 0x10000000L); default : break; } return jjStartNfa_3(11, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa13_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(11, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(12, active0, 0L, 0L); return 13; } switch(curChar) { case 105: return jjMoveStringLiteralDfa14_3(active0, 0x10000000L); case 116: return jjMoveStringLiteralDfa14_3(active0, 0x8000000L); default : break; } return jjStartNfa_3(12, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa14_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(12, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(13, active0, 0L, 0L); return 14; } switch(curChar) { case 105: return jjMoveStringLiteralDfa15_3(active0, 0x8000000L); case 111: return jjMoveStringLiteralDfa15_3(active0, 0x10000000L); default : break; } return jjStartNfa_3(13, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa15_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(13, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(14, active0, 0L, 0L); return 15; } switch(curChar) { case 110: return jjMoveStringLiteralDfa16_3(active0, 0x10000000L); case 111: return jjMoveStringLiteralDfa16_3(active0, 0x8000000L); default : break; } return jjStartNfa_3(14, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa16_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(14, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(15, active0, 0L, 0L); return 16; } switch(curChar) { case 62: if ((active0 & 0x10000000L) != 0L) return jjStopAtPos(16, 28); break; case 110: return jjMoveStringLiteralDfa17_3(active0, 0x8000000L); default : break; } return jjStartNfa_3(15, active0, 0L, 0L); } private final int jjMoveStringLiteralDfa17_3(long old0, long active0) { if (((active0 &= old0)) == 0L) return jjStartNfa_3(15, old0, 0L, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_3(16, active0, 0L, 0L); return 17; } switch(curChar) { case 62: if ((active0 & 0x8000000L) != 0L) return jjStopAtPos(17, 27); break; default : break; } return jjStartNfa_3(16, active0, 0L, 0L); } 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 final int jjMoveNfa_3(int startState, int curPos) { int[] nextStates; int startsAt = 0; jjnewStateCnt = 61; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 4: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(8, 14); else if (curChar == 39) jjCheckNAddStates(15, 19); else if (curChar == 36) { if (kind > 122) kind = 122; jjCheckNAdd(24); } else if (curChar == 34) jjCheckNAddStates(20, 22); else if (curChar == 46) jjCheckNAdd(9); else if (curChar == 37) jjstateSet[jjnewStateCnt++] = 0; if ((0x3fe000000000000L & l) != 0L) { if (kind > 113) kind = 113; jjCheckNAddTwoStates(6, 7); } else if (curChar == 48) { if (kind > 113) kind = 113; jjCheckNAddStates(23, 25); } break; case 0: if (curChar != 62) break; if (kind > 26) kind = 26; jjAddStates(26, 27); break; case 1: if ((0x2400L & l) != 0L && kind > 26) kind = 26; break; case 2: if (curChar == 10 && kind > 26) kind = 26; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 5: if ((0x3fe000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(6, 7); break; case 6: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(6, 7); break; case 8: if (curChar == 46) jjCheckNAdd(9); break; case 9: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddStates(28, 30); break; case 11: if ((0x280000000000L & l) != 0L) jjCheckNAdd(12); break; case 12: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddTwoStates(12, 13); break; case 14: if (curChar == 34) jjCheckNAddStates(20, 22); break; case 15: if ((0xfffffffbffffdbffL & l) != 0L) jjCheckNAddStates(20, 22); break; case 17: if ((0x8400000000L & l) != 0L) jjCheckNAddStates(20, 22); break; case 18: if (curChar == 34 && kind > 120) kind = 120; break; case 19: if ((0xff000000000000L & l) != 0L) jjCheckNAddStates(31, 34); break; case 20: if ((0xff000000000000L & l) != 0L) jjCheckNAddStates(20, 22); break; case 21: if ((0xf000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 22; break; case 22: if ((0xff000000000000L & l) != 0L) jjCheckNAdd(20); break; case 23: if (curChar != 36) break; if (kind > 122) kind = 122; jjCheckNAdd(24); break; case 24: if ((0x3ff001000000000L & l) == 0L) break; if (kind > 122) kind = 122; jjCheckNAdd(24); break; case 25: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(8, 14); break; case 26: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(26, 27); break; case 27: if (curChar != 46) break; if (kind > 117) kind = 117; jjCheckNAddStates(35, 37); break; case 28: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddStates(35, 37); break; case 30: if ((0x280000000000L & l) != 0L) jjCheckNAdd(31); break; case 31: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddTwoStates(31, 13); break; case 32: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(32, 33); break; case 34: if ((0x280000000000L & l) != 0L) jjCheckNAdd(35); break; case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddTwoStates(35, 13); break; case 36: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(38, 40); break; case 38: if ((0x280000000000L & l) != 0L) jjCheckNAdd(39); break; case 39: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(39, 13); break; case 40: if (curChar != 48) break; if (kind > 113) kind = 113; jjCheckNAddStates(23, 25); break; case 42: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(42, 7); break; case 43: if ((0xff000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(43, 7); break; case 44: if (curChar == 39) jjCheckNAddStates(15, 19); break; case 45: if ((0xffffff7fffffdbffL & l) != 0L) jjCheckNAdd(46); break; case 46: if (curChar == 39 && kind > 119) kind = 119; break; case 48: if ((0x8400000000L & l) != 0L) jjCheckNAdd(46); break; case 49: if ((0xff000000000000L & l) != 0L) jjCheckNAddTwoStates(50, 46); break; case 50: if ((0xff000000000000L & l) != 0L) jjCheckNAdd(46); break; case 51: if ((0xf000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 52; break; case 52: if ((0xff000000000000L & l) != 0L) jjCheckNAdd(50); break; case 53: if ((0xffffff7fffffdbffL & l) != 0L) jjCheckNAddStates(41, 43); break; case 55: if ((0x8400000000L & l) != 0L) jjCheckNAddStates(41, 43); break; case 56: if (curChar == 39 && kind > 121) kind = 121; break; case 57: if ((0xff000000000000L & l) != 0L) jjCheckNAddStates(44, 47); break; case 58: if ((0xff000000000000L & l) != 0L) jjCheckNAddStates(41, 43); break; case 59: if ((0xf000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 60; break; case 60: if ((0xff000000000000L & l) != 0L) jjCheckNAdd(58); break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 4: case 24: if ((0x7fffffe87fffffeL & l) == 0L) break; if (kind > 122) kind = 122; jjCheckNAdd(24); break; case 7: if ((0x100000001000L & l) != 0L && kind > 113) kind = 113; break; case 10: if ((0x2000000020L & l) != 0L) jjAddStates(48, 49); break; case 13: if ((0x5000000050L & l) != 0L && kind > 117) kind = 117; break; case 15: if ((0xffffffffefffffffL & l) != 0L) jjCheckNAddStates(20, 22); break; case 16: if (curChar == 92) jjAddStates(50, 52); break; case 17: if ((0x14404410000000L & l) != 0L) jjCheckNAddStates(20, 22); break; case 29: if ((0x2000000020L & l) != 0L) jjAddStates(53, 54); break; case 33: if ((0x2000000020L & l) != 0L) jjAddStates(55, 56); break; case 37: if ((0x2000000020L & l) != 0L) jjAddStates(57, 58); break; case 41: if ((0x100000001000000L & l) != 0L) jjCheckNAdd(42); break; case 42: if ((0x7e0000007eL & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(42, 7); break; case 45: if ((0xffffffffefffffffL & l) != 0L) jjCheckNAdd(46); break; case 47: if (curChar == 92) jjAddStates(59, 61); break; case 48: if ((0x14404410000000L & l) != 0L) jjCheckNAdd(46); break; case 53: if ((0xffffffffefffffffL & l) != 0L) jjCheckNAddStates(41, 43); break; case 54: if (curChar == 92) jjAddStates(62, 64); break; case 55: if ((0x14404410000000L & l) != 0L) jjCheckNAddStates(41, 43); 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); MatchLoop: do { switch(jjstateSet[--i]) { case 4: case 24: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; if (kind > 122) kind = 122; jjCheckNAdd(24); break; case 15: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjAddStates(20, 22); break; case 45: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjstateSet[jjnewStateCnt++] = 46; break; case 53: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjAddStates(41, 43); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 61 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } private final int jjMoveStringLiteralDfa0_4() { switch(curChar) { case 45: return jjMoveStringLiteralDfa1_4(0x7800000000L); default : return 1; } } private final int jjMoveStringLiteralDfa1_4(long active0) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return 1; } switch(curChar) { case 45: return jjMoveStringLiteralDfa2_4(active0, 0x7800000000L); default : return 2; } } private final int jjMoveStringLiteralDfa2_4(long old0, long active0) { if (((active0 &= old0)) == 0L) return 2; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return 2; } switch(curChar) { case 37: return jjMoveStringLiteralDfa3_4(active0, 0x7800000000L); default : return 3; } } private final int jjMoveStringLiteralDfa3_4(long old0, long active0) { if (((active0 &= old0)) == 0L) return 3; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return 3; } switch(curChar) { case 62: if ((active0 & 0x800000000L) != 0L) { jjmatchedKind = 35; jjmatchedPos = 3; } return jjMoveStringLiteralDfa4_4(active0, 0x7000000000L); default : return 4; } } private final int jjMoveStringLiteralDfa4_4(long old0, long active0) { if (((active0 &= old0)) == 0L) return 4; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return 4; } switch(curChar) { case 10: if ((active0 & 0x2000000000L) != 0L) return jjStopAtPos(4, 37); break; case 13: if ((active0 & 0x1000000000L) != 0L) { jjmatchedKind = 36; jjmatchedPos = 4; } return jjMoveStringLiteralDfa5_4(active0, 0x4000000000L); default : return 5; } return 5; } private final int jjMoveStringLiteralDfa5_4(long old0, long active0) { if (((active0 &= old0)) == 0L) return 5; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return 5; } switch(curChar) { case 10: if ((active0 & 0x4000000000L) != 0L) return jjStopAtPos(5, 38); break; default : return 6; } return 6; } private final int jjStopStringLiteralDfa_2(int pos, long active0, long active1, long active2) { switch (pos) { case 0: if ((active2 & 0x10020000000L) != 0L) return 0; if ((active2 & 0x20040008200L) != 0L) return 22; if ((active0 & 0xfffff80000000000L) != 0L || (active1 & 0x77fffffffL) != 0L) { jjmatchedKind = 122; return 56; } if ((active0 & 0x140000000L) != 0L || (active2 & 0x1002000000L) != 0L) return 26; if ((active1 & 0x80000000L) != 0L || (active2 & 0x20L) != 0L) return 32; return -1; case 1: if ((active0 & 0x100000000L) != 0L) return 24; if ((active0 & 0x7f3ff80000000000L) != 0L || (active1 & 0x77fffffffL) != 0L) { if (jjmatchedPos != 1) { jjmatchedKind = 122; jjmatchedPos = 1; } return 56; } if ((active0 & 0x80c0000000000000L) != 0L) return 56; return -1; case 2: if ((active0 & 0x5fbff80000000000L) != 0L || (active1 & 0x76fbfff67L) != 0L) { if (jjmatchedPos != 2) { jjmatchedKind = 122; jjmatchedPos = 2; } return 56; } if ((active0 & 0x2000000000000000L) != 0L || (active1 & 0x10400098L) != 0L) return 56; return -1; case 3: if ((active0 & 0x1ebd380000000000L) != 0L || (active1 & 0x42f3bff57L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 3; return 56; } if ((active0 & 0x4102c00000000000L) != 0L || (active1 & 0x340840020L) != 0L) return 56; return -1; case 4: if ((active0 & 0x2b0180000000000L) != 0L || (active1 & 0x2d235f57L) != 0L) { if (jjmatchedPos != 4) { jjmatchedKind = 122; jjmatchedPos = 4; } return 56; } if ((active0 & 0x1c0d200000000000L) != 0L || (active1 & 0x40218a000L) != 0L) return 56; return -1; case 5: if ((active0 & 0xa30180000000000L) != 0L || (active1 & 0x25220715L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 5; return 56; } if ((active0 & 0x80000000000000L) != 0L || (active1 & 0x8115842L) != 0L) return 56; return -1; case 6: if ((active0 & 0x10080000000000L) != 0L || (active1 & 0x25220415L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 6; return 56; } if ((active0 & 0xa20100000000000L) != 0L || (active1 & 0x300L) != 0L) return 56; return -1; case 7: if ((active1 & 0x220415L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 7; return 56; } if ((active0 & 0x10080000000000L) != 0L || (active1 & 0x25000000L) != 0L) return 56; return -1; case 8: if ((active1 & 0x20005L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 8; return 56; } if ((active1 & 0x200410L) != 0L) return 56; return -1; case 9: if ((active1 & 0x20000L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 9; return 56; } if ((active1 & 0x5L) != 0L) return 56; return -1; case 10: if ((active1 & 0x20000L) != 0L) { jjmatchedKind = 122; jjmatchedPos = 10; return 56; } return -1; default : return -1; } } private final int jjStartNfa_2(int pos, long active0, long active1, long active2) { return jjMoveNfa_2(jjStopStringLiteralDfa_2(pos, active0, active1, active2), pos + 1); } private final int jjStartNfaWithStates_2(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_2(state, pos + 1); } private final int jjMoveStringLiteralDfa0_2() { switch(curChar) { case 33: jjmatchedKind = 138; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x20000L); case 37: jjmatchedKind = 157; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x10000000000L); case 38: jjmatchedKind = 154; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x2000080000L); case 40: return jjStopAtPos(0, 127); case 41: return jjStopAtPos(0, 128); case 42: jjmatchedKind = 152; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x800000000L); case 43: jjmatchedKind = 150; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x200100000L); case 44: return jjStopAtPos(0, 132); case 45: jjmatchedKind = 151; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x400200000L); case 46: jjmatchedKind = 133; return jjMoveStringLiteralDfa1_2(0x0L, 0x80000000L, 0x0L); case 47: jjmatchedKind = 153; return jjMoveStringLiteralDfa1_2(0x140000000L, 0x0L, 0x1000000000L); case 58: return jjStopAtPos(0, 141); case 59: return jjStopAtPos(0, 131); case 60: jjmatchedKind = 137; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x20040008000L); case 61: jjmatchedKind = 135; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x4000L); case 62: jjmatchedKind = 136; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0xc0180010000L); case 63: return jjStopAtPos(0, 140); case 91: return jjStopAtPos(0, 129); case 93: return jjStopAtPos(0, 130); case 94: jjmatchedKind = 156; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x8000000000L); case 96: return jjStopAtPos(0, 134); case 97: return jjMoveStringLiteralDfa1_2(0x80000000000L, 0x8000000L, 0x0L); case 98: return jjMoveStringLiteralDfa1_2(0x700000000000L, 0x0L, 0x0L); case 99: return jjMoveStringLiteralDfa1_2(0x1f800000000000L, 0x0L, 0x0L); case 100: return jjMoveStringLiteralDfa1_2(0xe0000000000000L, 0x0L, 0x0L); case 101: return jjMoveStringLiteralDfa1_2(0x300000000000000L, 0x40000000L, 0x0L); case 102: return jjMoveStringLiteralDfa1_2(0x3c00000000000000L, 0x420000000L, 0x0L); case 103: return jjMoveStringLiteralDfa1_2(0x4000000000000000L, 0x0L, 0x0L); case 105: return jjMoveStringLiteralDfa1_2(0x8000000000000000L, 0x1fL, 0x0L); case 108: return jjMoveStringLiteralDfa1_2(0x0L, 0x20L, 0x0L); case 110: return jjMoveStringLiteralDfa1_2(0x0L, 0x1000000c0L, 0x0L); case 112: return jjMoveStringLiteralDfa1_2(0x0L, 0xf00L, 0x0L); case 114: return jjMoveStringLiteralDfa1_2(0x0L, 0x1000L, 0x0L); case 115: return jjMoveStringLiteralDfa1_2(0x0L, 0x403e000L, 0x0L); case 116: return jjMoveStringLiteralDfa1_2(0x0L, 0x2007c0000L, 0x0L); case 118: return jjMoveStringLiteralDfa1_2(0x0L, 0x11800000L, 0x0L); case 119: return jjMoveStringLiteralDfa1_2(0x0L, 0x2000000L, 0x0L); case 123: return jjStopAtPos(0, 125); case 124: jjmatchedKind = 155; return jjMoveStringLiteralDfa1_2(0x0L, 0x0L, 0x4000040000L); case 125: return jjStopAtPos(0, 126); case 126: return jjStopAtPos(0, 139); default : return jjMoveNfa_2(4, 0); } } private final int jjMoveStringLiteralDfa1_2(long active0, long active1, long active2) { try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(0, active0, active1, active2); return 1; } switch(curChar) { case 38: if ((active2 & 0x80000L) != 0L) return jjStopAtPos(1, 147); break; case 42: if ((active0 & 0x100000000L) != 0L) return jjStartNfaWithStates_2(1, 32, 24); break; case 43: if ((active2 & 0x100000L) != 0L) return jjStopAtPos(1, 148); break; case 45: if ((active2 & 0x200000L) != 0L) return jjStopAtPos(1, 149); break; case 46: return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0x80000000L, active2, 0L); case 47: if ((active0 & 0x40000000L) != 0L) return jjStopAtPos(1, 30); break; case 60: if ((active2 & 0x40000000L) != 0L) { jjmatchedKind = 158; jjmatchedPos = 1; } return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0L, active2, 0x20000000000L); case 61: if ((active2 & 0x4000L) != 0L) return jjStopAtPos(1, 142); else if ((active2 & 0x8000L) != 0L) return jjStopAtPos(1, 143); else if ((active2 & 0x10000L) != 0L) return jjStopAtPos(1, 144); else if ((active2 & 0x20000L) != 0L) return jjStopAtPos(1, 145); else if ((active2 & 0x200000000L) != 0L) return jjStopAtPos(1, 161); else if ((active2 & 0x400000000L) != 0L) return jjStopAtPos(1, 162); else if ((active2 & 0x800000000L) != 0L) return jjStopAtPos(1, 163); else if ((active2 & 0x1000000000L) != 0L) return jjStopAtPos(1, 164); else if ((active2 & 0x2000000000L) != 0L) return jjStopAtPos(1, 165); else if ((active2 & 0x4000000000L) != 0L) return jjStopAtPos(1, 166); else if ((active2 & 0x8000000000L) != 0L) return jjStopAtPos(1, 167); else if ((active2 & 0x10000000000L) != 0L) return jjStopAtPos(1, 168); break; case 62: if ((active2 & 0x80000000L) != 0L) { jjmatchedKind = 159; jjmatchedPos = 1; } return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0L, active2, 0xc0100000000L); case 97: return jjMoveStringLiteralDfa2_2(active0, 0x1800000000000L, active1, 0x410000140L, active2, 0L); case 98: return jjMoveStringLiteralDfa2_2(active0, 0x80000000000L, active1, 0L, active2, 0L); case 101: return jjMoveStringLiteralDfa2_2(active0, 0x20000000000000L, active1, 0x1080L, active2, 0L); case 102: if ((active0 & 0x8000000000000000L) != 0L) return jjStartNfaWithStates_2(1, 63, 56); break; case 104: return jjMoveStringLiteralDfa2_2(active0, 0x2000000000000L, active1, 0x21c2000L, active2, 0L); case 105: return jjMoveStringLiteralDfa2_2(active0, 0xc00000000000000L, active1, 0L, active2, 0L); case 108: return jjMoveStringLiteralDfa2_2(active0, 0x1104000000000000L, active1, 0L, active2, 0L); case 109: return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0x3L, active2, 0L); case 110: return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0x1cL, active2, 0L); case 111: if ((active0 & 0x40000000000000L) != 0L) { jjmatchedKind = 54; jjmatchedPos = 1; } return jjMoveStringLiteralDfa2_2(active0, 0x6098100000000000L, active1, 0x1800020L, active2, 0L); case 114: return jjMoveStringLiteralDfa2_2(active0, 0x200000000000L, active1, 0x200600600L, active2, 0L); case 115: return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0x8000000L, active2, 0L); case 116: return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0x4004000L, active2, 0L); case 117: return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0x120008800L, active2, 0L); case 119: return jjMoveStringLiteralDfa2_2(active0, 0L, active1, 0x10000L, active2, 0L); case 120: return jjMoveStringLiteralDfa2_2(active0, 0x200000000000000L, active1, 0x40000000L, active2, 0L); case 121: return jjMoveStringLiteralDfa2_2(active0, 0x400000000000L, active1, 0x20000L, active2, 0L); case 124: if ((active2 & 0x40000L) != 0L) return jjStopAtPos(1, 146); break; default : break; } return jjStartNfa_2(0, active0, active1, active2); } private final int jjMoveStringLiteralDfa2_2(long old0, long active0, long old1, long active1, long old2, long active2) { if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) return jjStartNfa_2(0, old0, old1, old2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(1, active0, active1, active2); return 2; } switch(curChar) { case 46: if ((active1 & 0x80000000L) != 0L) return jjStopAtPos(2, 95); break; case 61: if ((active2 & 0x20000000000L) != 0L) return jjStopAtPos(2, 169); else if ((active2 & 0x40000000000L) != 0L) return jjStopAtPos(2, 170); break; case 62: if ((active2 & 0x100000000L) != 0L) { jjmatchedKind = 160; jjmatchedPos = 2; } return jjMoveStringLiteralDfa3_2(active0, 0L, active1, 0L, active2, 0x80000000000L); case 97: return jjMoveStringLiteralDfa3_2(active0, 0x6000000000000L, active1, 0x204000L, active2, 0L); case 98: return jjMoveStringLiteralDfa3_2(active0, 0L, active1, 0x800L, active2, 0L); case 99: return jjMoveStringLiteralDfa3_2(active0, 0L, active1, 0x100L, active2, 0L); case 101: return jjMoveStringLiteralDfa3_2(active0, 0x200000000000L, active1, 0L, active2, 0L); case 102: return jjMoveStringLiteralDfa3_2(active0, 0x20000000000000L, active1, 0L, active2, 0L); case 105: return jjMoveStringLiteralDfa3_2(active0, 0L, active1, 0x42850200L, active2, 0L); case 108: return jjMoveStringLiteralDfa3_2(active0, 0L, active1, 0x501000000L, active2, 0L); case 110: return jjMoveStringLiteralDfa3_2(active0, 0xc18000000000000L, active1, 0x20020020L, active2, 0L); case 111: return jjMoveStringLiteralDfa3_2(active0, 0x1000100000000000L, active1, 0x2400L, active2, 0L); case 112: return jjMoveStringLiteralDfa3_2(active0, 0L, active1, 0x8003L, active2, 0L); case 114: if ((active0 & 0x2000000000000000L) != 0L) return jjStartNfaWithStates_2(2, 61, 56); else if ((active1 & 0x10000000L) != 0L) return jjStartNfaWithStates_2(2, 92, 56); return jjMoveStringLiteralDfa3_2(active0, 0L, active1, 0x4180000L, active2, 0L); case 115: return jjMoveStringLiteralDfa3_2(active0, 0x100880000000000L, active1, 0x8000004L, active2, 0L); case 116: if ((active1 & 0x8L) != 0L) { jjmatchedKind = 67; jjmatchedPos = 2; } return jjMoveStringLiteralDfa3_2(active0, 0x4201400000000000L, active1, 0x1050L, active2, 0L); case 117: return jjMoveStringLiteralDfa3_2(active0, 0x80000000000000L, active1, 0x200000000L, active2, 0L); case 119: if ((active1 & 0x80L) != 0L) return jjStartNfaWithStates_2(2, 71, 56); break; case 121: if ((active1 & 0x400000L) != 0L) return jjStartNfaWithStates_2(2, 86, 56); break; default : break; } return jjStartNfa_2(1, active0, active1, active2); } private final int jjMoveStringLiteralDfa3_2(long old0, long active0, long old1, long active1, long old2, long active2) { if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) return jjStartNfa_2(1, old0, old1, old2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(2, active0, active1, active2); return 3; } switch(curChar) { case 61: if ((active2 & 0x80000000000L) != 0L) return jjStopAtPos(3, 171); break; case 97: return jjMoveStringLiteralDfa4_2(active0, 0x1c20200000000000L, active1, 0x1000000L, active2, 0L); case 98: return jjMoveStringLiteralDfa4_2(active0, 0x80000000000000L, active1, 0L, active2, 0L); case 99: return jjMoveStringLiteralDfa4_2(active0, 0x1000000000000L, active1, 0x20020000L, active2, 0L); case 100: if ((active1 & 0x800000L) != 0L) return jjStartNfaWithStates_2(3, 87, 56); break; case 101: if ((active0 & 0x400000000000L) != 0L) return jjStartNfaWithStates_2(3, 46, 56); else if ((active0 & 0x800000000000L) != 0L) return jjStartNfaWithStates_2(3, 47, 56); else if ((active0 & 0x100000000000000L) != 0L) return jjStartNfaWithStates_2(3, 56, 56); else if ((active1 & 0x200000000L) != 0L) return jjStartNfaWithStates_2(3, 97, 56); return jjMoveStringLiteralDfa4_2(active0, 0x200000000000000L, active1, 0x8008010L, active2, 0L); case 103: if ((active1 & 0x20L) != 0L) return jjStartNfaWithStates_2(3, 69, 56); break; case 105: return jjMoveStringLiteralDfa4_2(active0, 0L, active1, 0x4000040L, active2, 0L); case 107: return jjMoveStringLiteralDfa4_2(active0, 0L, active1, 0x100L, active2, 0L); case 108: if ((active1 & 0x100000000L) != 0L) return jjStartNfaWithStates_2(3, 96, 56); return jjMoveStringLiteralDfa4_2(active0, 0x100000000000L, active1, 0x2000801L, active2, 0L); case 110: return jjMoveStringLiteralDfa4_2(active0, 0L, active1, 0x200000L, active2, 0L); case 111: if ((active0 & 0x4000000000000000L) != 0L) return jjStartNfaWithStates_2(3, 62, 56); return jjMoveStringLiteralDfa4_2(active0, 0L, active1, 0x180002L, active2, 0L); case 114: if ((active0 & 0x2000000000000L) != 0L) return jjStartNfaWithStates_2(3, 49, 56); return jjMoveStringLiteralDfa4_2(active0, 0L, active1, 0x2000L, active2, 0L); case 115: if ((active1 & 0x40000L) != 0L) return jjStartNfaWithStates_2(3, 82, 56); return jjMoveStringLiteralDfa4_2(active0, 0xc000000000000L, active1, 0x400000000L, active2, 0L); case 116: if ((active1 & 0x40000000L) != 0L) return jjStartNfaWithStates_2(3, 94, 56); return jjMoveStringLiteralDfa4_2(active0, 0x10080000000000L, active1, 0x14404L, active2, 0L); case 117: return jjMoveStringLiteralDfa4_2(active0, 0L, active1, 0x1000L, active2, 0L); case 118: return jjMoveStringLiteralDfa4_2(active0, 0L, active1, 0x200L, active2, 0L); default : break; } return jjStartNfa_2(2, active0, active1, active2); } private final int jjMoveStringLiteralDfa4_2(long old0, long active0, long old1, long active1, long old2, long active2) { if (((active0 &= old0) | (active1 &= old1) | (active2 &= old2)) == 0L) return jjStartNfa_2(2, old0, old1, old2); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(3, active0, active1, 0L); return 4; } switch(curChar) { case 97: return jjMoveStringLiteralDfa5_2(active0, 0L, active1, 0x304L); case 99: return jjMoveStringLiteralDfa5_2(active0, 0L, active1, 0x4010000L); case 101: if ((active1 & 0x2000000L) != 0L) return jjStartNfaWithStates_2(4, 89, 56); else if ((active1 & 0x400000000L) != 0L) return jjStartNfaWithStates_2(4, 98, 56); return jjMoveStringLiteralDfa5_2(active0, 0x100000000000L, active1, 0x401L); case 104: if ((active0 & 0x1000000000000L) != 0L) return jjStartNfaWithStates_2(4, 48, 56); return jjMoveStringLiteralDfa5_2(active0, 0L, active1, 0x20000L); case 105: return jjMoveStringLiteralDfa5_2(active0, 0x10000000000000L, active1, 0x4800L); case 107: if ((active0 & 0x200000000000L) != 0L) return jjStartNfaWithStates_2(4, 45, 56); break; case 108: if ((active0 & 0x400000000000000L) != 0L) { jjmatchedKind = 58; jjmatchedPos = 4; } return jjMoveStringLiteralDfa5_2(active0, 0x880000000000000L, active1, 0L); case 110: return jjMoveStringLiteralDfa5_2(active0, 0x200000000000000L, active1, 0L); case 114: if ((active1 & 0x8000L) != 0L) return jjStartNfaWithStates_2(4, 79, 56); return jjMoveStringLiteralDfa5_2(active0, 0x80000000000L, active1, 0x8001012L); case 115: if ((active0 & 0x4000000000000L) != 0L) return jjStartNfaWithStates_2(4, 50, 56); return jjMoveStringLiteralDfa5_2(active0, 0L, active1, 0x200000L); case 116: if ((active0 & 0x8000000000000L) != 0L) return jjStartNfaWithStates_2(4, 51, 56); else if ((active0 & 0x1000000000000000L) != 0L) return jjStartNfaWithStates_2(4, 60, 56); else if ((active1 & 0x2000L) != 0L) return jjStartNfaWithStates_2(4, 77, 56); return jjMoveStringLiteralDfa5_2(active0, 0L, active1, 0x21000000L); case 117: return jjMoveStringLiteralDfa5_2(active0, 0x20000000000000L, active1, 0L); case 118: return jjMoveStringLiteralDfa5_2(active0, 0L, active1, 0x40L); case 119: if ((active1 & 0x80000L) != 0L) { jjmatchedKind = 83; jjmatchedPos = 4; } return jjMoveStringLiteralDfa5_2(active0, 0L, active1, 0x100000L); default : break; } return jjStartNfa_2(3, active0, active1, 0L); } private final int jjMoveStringLiteralDfa5_2(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_2(3, old0, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(4, active0, active1, 0L); return 5; } switch(curChar) { case 97: return jjMoveStringLiteralDfa6_2(active0, 0x180000000000L, active1, 0L); case 99: if ((active1 & 0x800L) != 0L) return jjStartNfaWithStates_2(5, 75, 56); else if ((active1 & 0x4000L) != 0L) return jjStartNfaWithStates_2(5, 78, 56); return jjMoveStringLiteralDfa6_2(active0, 0L, active1, 0x400L); case 100: return jjMoveStringLiteralDfa6_2(active0, 0x200000000000000L, active1, 0L); case 101: if ((active0 & 0x80000000000000L) != 0L) return jjStartNfaWithStates_2(5, 55, 56); else if ((active1 & 0x40L) != 0L) return jjStartNfaWithStates_2(5, 70, 56); break; case 102: return jjMoveStringLiteralDfa6_2(active0, 0L, active1, 0x10L); case 103: return jjMoveStringLiteralDfa6_2(active0, 0L, active1, 0x100L); case 104: if ((active1 & 0x10000L) != 0L) return jjStartNfaWithStates_2(5, 80, 56); break; case 105: return jjMoveStringLiteralDfa6_2(active0, 0L, active1, 0x21200000L); case 108: return jjMoveStringLiteralDfa6_2(active0, 0x820000000000000L, active1, 0L); case 109: return jjMoveStringLiteralDfa6_2(active0, 0L, active1, 0x1L); case 110: if ((active1 & 0x1000L) != 0L) return jjStartNfaWithStates_2(5, 76, 56); return jjMoveStringLiteralDfa6_2(active0, 0x10000000000000L, active1, 0x4L); case 114: return jjMoveStringLiteralDfa6_2(active0, 0L, active1, 0x20000L); case 115: if ((active1 & 0x100000L) != 0L) return jjStartNfaWithStates_2(5, 84, 56); break; case 116: if ((active1 & 0x2L) != 0L) return jjStartNfaWithStates_2(5, 65, 56); else if ((active1 & 0x8000000L) != 0L) return jjStartNfaWithStates_2(5, 91, 56); return jjMoveStringLiteralDfa6_2(active0, 0L, active1, 0x4000200L); default : break; } return jjStartNfa_2(4, active0, active1, 0L); } private final int jjMoveStringLiteralDfa6_2(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_2(4, old0, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(5, active0, active1, 0L); return 6; } switch(curChar) { case 97: return jjMoveStringLiteralDfa7_2(active0, 0L, active1, 0x10L); case 99: return jjMoveStringLiteralDfa7_2(active0, 0x80000000000L, active1, 0x4L); case 101: if ((active1 & 0x100L) != 0L) return jjStartNfaWithStates_2(6, 72, 56); else if ((active1 & 0x200L) != 0L) return jjStartNfaWithStates_2(6, 73, 56); return jjMoveStringLiteralDfa7_2(active0, 0L, active1, 0x200001L); case 102: return jjMoveStringLiteralDfa7_2(active0, 0L, active1, 0x4000000L); case 108: return jjMoveStringLiteralDfa7_2(active0, 0L, active1, 0x1000000L); case 110: if ((active0 & 0x100000000000L) != 0L) return jjStartNfaWithStates_2(6, 44, 56); break; case 111: return jjMoveStringLiteralDfa7_2(active0, 0L, active1, 0x20020000L); case 115: if ((active0 & 0x200000000000000L) != 0L) return jjStartNfaWithStates_2(6, 57, 56); break; case 116: if ((active0 & 0x20000000000000L) != 0L) return jjStartNfaWithStates_2(6, 53, 56); return jjMoveStringLiteralDfa7_2(active0, 0L, active1, 0x400L); case 117: return jjMoveStringLiteralDfa7_2(active0, 0x10000000000000L, active1, 0L); case 121: if ((active0 & 0x800000000000000L) != 0L) return jjStartNfaWithStates_2(6, 59, 56); break; default : break; } return jjStartNfa_2(5, active0, active1, 0L); } private final int jjMoveStringLiteralDfa7_2(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_2(5, old0, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(6, active0, active1, 0L); return 7; } switch(curChar) { case 99: return jjMoveStringLiteralDfa8_2(active0, 0L, active1, 0x10L); case 101: if ((active0 & 0x10000000000000L) != 0L) return jjStartNfaWithStates_2(7, 52, 56); else if ((active1 & 0x1000000L) != 0L) return jjStartNfaWithStates_2(7, 88, 56); return jjMoveStringLiteralDfa8_2(active0, 0L, active1, 0x404L); case 110: if ((active1 & 0x20000000L) != 0L) return jjStartNfaWithStates_2(7, 93, 56); return jjMoveStringLiteralDfa8_2(active0, 0L, active1, 0x220001L); case 112: if ((active1 & 0x4000000L) != 0L) return jjStartNfaWithStates_2(7, 90, 56); break; case 116: if ((active0 & 0x80000000000L) != 0L) return jjStartNfaWithStates_2(7, 43, 56); break; default : break; } return jjStartNfa_2(6, active0, active1, 0L); } private final int jjMoveStringLiteralDfa8_2(long old0, long active0, long old1, long active1) { if (((active0 &= old0) | (active1 &= old1)) == 0L) return jjStartNfa_2(6, old0, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(7, 0L, active1, 0L); return 8; } switch(curChar) { case 100: if ((active1 & 0x400L) != 0L) return jjStartNfaWithStates_2(8, 74, 56); break; case 101: if ((active1 & 0x10L) != 0L) return jjStartNfaWithStates_2(8, 68, 56); break; case 105: return jjMoveStringLiteralDfa9_2(active1, 0x20000L); case 111: return jjMoveStringLiteralDfa9_2(active1, 0x4L); case 116: if ((active1 & 0x200000L) != 0L) return jjStartNfaWithStates_2(8, 85, 56); return jjMoveStringLiteralDfa9_2(active1, 0x1L); default : break; } return jjStartNfa_2(7, 0L, active1, 0L); } private final int jjMoveStringLiteralDfa9_2(long old1, long active1) { if (((active1 &= old1)) == 0L) return jjStartNfa_2(7, 0L, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(8, 0L, active1, 0L); return 9; } switch(curChar) { case 102: if ((active1 & 0x4L) != 0L) return jjStartNfaWithStates_2(9, 66, 56); break; case 115: if ((active1 & 0x1L) != 0L) return jjStartNfaWithStates_2(9, 64, 56); break; case 122: return jjMoveStringLiteralDfa10_2(active1, 0x20000L); default : break; } return jjStartNfa_2(8, 0L, active1, 0L); } private final int jjMoveStringLiteralDfa10_2(long old1, long active1) { if (((active1 &= old1)) == 0L) return jjStartNfa_2(8, 0L, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(9, 0L, active1, 0L); return 10; } switch(curChar) { case 101: return jjMoveStringLiteralDfa11_2(active1, 0x20000L); default : break; } return jjStartNfa_2(9, 0L, active1, 0L); } private final int jjMoveStringLiteralDfa11_2(long old1, long active1) { if (((active1 &= old1)) == 0L) return jjStartNfa_2(9, 0L, old1, 0L); try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { jjStopStringLiteralDfa_2(10, 0L, active1, 0L); return 11; } switch(curChar) { case 100: if ((active1 & 0x20000L) != 0L) return jjStartNfaWithStates_2(11, 81, 56); break; default : break; } return jjStartNfa_2(10, 0L, active1, 0L); } private final int jjMoveNfa_2(int startState, int curPos) { int[] nextStates; int startsAt = 0; jjnewStateCnt = 76; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 4: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(65, 71); else if (curChar == 36) { if (kind > 122) kind = 122; jjCheckNAdd(56); } else if (curChar == 34) jjCheckNAddStates(72, 74); else if (curChar == 39) jjAddStates(75, 76); else if (curChar == 46) jjCheckNAdd(32); else if (curChar == 47) jjstateSet[jjnewStateCnt++] = 26; else if (curChar == 60) jjstateSet[jjnewStateCnt++] = 22; else if (curChar == 37) jjstateSet[jjnewStateCnt++] = 0; if ((0x3fe000000000000L & l) != 0L) { if (kind > 113) kind = 113; jjCheckNAddTwoStates(29, 30); } else if (curChar == 48) { if (kind > 113) kind = 113; jjCheckNAddStates(77, 79); } break; case 0: if (curChar != 62) break; if (kind > 19) kind = 19; jjAddStates(26, 27); break; case 1: if ((0x2400L & l) != 0L && kind > 19) kind = 19; break; case 2: if (curChar == 10 && kind > 19) kind = 19; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 5: if (curChar != 62) break; if (kind > 20) kind = 20; jjAddStates(80, 81); break; case 6: if ((0x2400L & l) != 0L && kind > 20) kind = 20; break; case 7: if (curChar == 10 && kind > 20) kind = 20; break; case 8: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 7; break; case 18: if (curChar == 58) jjstateSet[jjnewStateCnt++] = 17; break; case 22: if (curChar == 47) jjstateSet[jjnewStateCnt++] = 21; break; case 23: if (curChar == 60) jjstateSet[jjnewStateCnt++] = 22; break; case 24: if (curChar == 42) jjstateSet[jjnewStateCnt++] = 25; break; case 25: if ((0xffff7fffffffffffL & l) != 0L && kind > 31) kind = 31; break; case 26: if (curChar == 42) jjstateSet[jjnewStateCnt++] = 24; break; case 27: if (curChar == 47) jjstateSet[jjnewStateCnt++] = 26; break; case 28: if ((0x3fe000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(29, 30); break; case 29: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(29, 30); break; case 31: if (curChar == 46) jjCheckNAdd(32); break; case 32: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddStates(82, 84); break; case 34: if ((0x280000000000L & l) != 0L) jjCheckNAdd(35); break; case 35: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddTwoStates(35, 36); break; case 37: if (curChar == 39) jjAddStates(75, 76); break; case 38: if ((0xffffff7fffffdbffL & l) != 0L) jjCheckNAdd(39); break; case 39: if (curChar == 39 && kind > 119) kind = 119; break; case 41: if ((0x8400000000L & l) != 0L) jjCheckNAdd(39); break; case 42: if ((0xff000000000000L & l) != 0L) jjCheckNAddTwoStates(43, 39); break; case 43: if ((0xff000000000000L & l) != 0L) jjCheckNAdd(39); break; case 44: if ((0xf000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 45; break; case 45: if ((0xff000000000000L & l) != 0L) jjCheckNAdd(43); break; case 46: if (curChar == 34) jjCheckNAddStates(72, 74); break; case 47: if ((0xfffffffbffffdbffL & l) != 0L) jjCheckNAddStates(72, 74); break; case 49: if ((0x8400000000L & l) != 0L) jjCheckNAddStates(72, 74); break; case 50: if (curChar == 34 && kind > 120) kind = 120; break; case 51: if ((0xff000000000000L & l) != 0L) jjCheckNAddStates(85, 88); break; case 52: if ((0xff000000000000L & l) != 0L) jjCheckNAddStates(72, 74); break; case 53: if ((0xf000000000000L & l) != 0L) jjstateSet[jjnewStateCnt++] = 54; break; case 54: if ((0xff000000000000L & l) != 0L) jjCheckNAdd(52); break; case 55: if (curChar != 36) break; if (kind > 122) kind = 122; jjCheckNAdd(56); break; case 56: if ((0x3ff001000000000L & l) == 0L) break; if (kind > 122) kind = 122; jjCheckNAdd(56); break; case 57: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(65, 71); break; case 58: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(58, 59); break; case 59: if (curChar != 46) break; if (kind > 117) kind = 117; jjCheckNAddStates(89, 91); break; case 60: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddStates(89, 91); break; case 62: if ((0x280000000000L & l) != 0L) jjCheckNAdd(63); break; case 63: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddTwoStates(63, 36); break; case 64: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(64, 65); break; case 66: if ((0x280000000000L & l) != 0L) jjCheckNAdd(67); break; case 67: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 117) kind = 117; jjCheckNAddTwoStates(67, 36); break; case 68: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddStates(92, 94); break; case 70: if ((0x280000000000L & l) != 0L) jjCheckNAdd(71); break; case 71: if ((0x3ff000000000000L & l) != 0L) jjCheckNAddTwoStates(71, 36); break; case 72: if (curChar != 48) break; if (kind > 113) kind = 113; jjCheckNAddStates(77, 79); break; case 74: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(74, 30); break; case 75: if ((0xff000000000000L & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(75, 30); break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 4: case 56: if ((0x7fffffe87fffffeL & l) == 0L) break; if (kind > 122) kind = 122; jjCheckNAdd(56); break; case 9: if (curChar == 116) jjstateSet[jjnewStateCnt++] = 5; break; case 10: if (curChar == 101) jjstateSet[jjnewStateCnt++] = 9; break; case 11: if (curChar == 108) jjstateSet[jjnewStateCnt++] = 10; break; case 12: if (curChar == 116) jjstateSet[jjnewStateCnt++] = 11; break; case 13: if (curChar == 112) jjstateSet[jjnewStateCnt++] = 12; break; case 14: if (curChar == 105) jjstateSet[jjnewStateCnt++] = 13; break; case 15: if (curChar == 114) jjstateSet[jjnewStateCnt++] = 14; break; case 16: if (curChar == 99) jjstateSet[jjnewStateCnt++] = 15; break; case 17: if (curChar == 115) jjstateSet[jjnewStateCnt++] = 16; break; case 19: if (curChar == 112) jjstateSet[jjnewStateCnt++] = 18; break; case 20: if (curChar == 115) jjstateSet[jjnewStateCnt++] = 19; break; case 21: if (curChar == 106) jjstateSet[jjnewStateCnt++] = 20; break; case 25: if (kind > 31) kind = 31; break; case 30: if ((0x100000001000L & l) != 0L && kind > 113) kind = 113; break; case 33: if ((0x2000000020L & l) != 0L) jjAddStates(55, 56); break; case 36: if ((0x5000000050L & l) != 0L && kind > 117) kind = 117; break; case 38: if ((0xffffffffefffffffL & l) != 0L) jjCheckNAdd(39); break; case 40: if (curChar == 92) jjAddStates(95, 97); break; case 41: if ((0x14404410000000L & l) != 0L) jjCheckNAdd(39); break; case 47: if ((0xffffffffefffffffL & l) != 0L) jjCheckNAddStates(72, 74); break; case 48: if (curChar == 92) jjAddStates(98, 100); break; case 49: if ((0x14404410000000L & l) != 0L) jjCheckNAddStates(72, 74); break; case 61: if ((0x2000000020L & l) != 0L) jjAddStates(101, 102); break; case 65: if ((0x2000000020L & l) != 0L) jjAddStates(103, 104); break; case 69: if ((0x2000000020L & l) != 0L) jjAddStates(105, 106); break; case 73: if ((0x100000001000000L & l) != 0L) jjCheckNAdd(74); break; case 74: if ((0x7e0000007eL & l) == 0L) break; if (kind > 113) kind = 113; jjCheckNAddTwoStates(74, 30); 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); MatchLoop: do { switch(jjstateSet[--i]) { case 4: case 56: if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) break; if (kind > 122) kind = 122; jjCheckNAdd(56); break; case 25: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 31) kind = 31; break; case 38: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjstateSet[jjnewStateCnt++] = 39; break; case 47: if (jjCanMove_0(hiByte, i1, i2, l1, l2)) jjAddStates(72, 74); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 76 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { 0, 2, 3, 4, 8, 1, 3, 4, 26, 27, 32, 33, 36, 37, 13, 45, 47, 53, 54, 56, 15, 16, 18, 41, 43, 7, 1, 3, 9, 10, 13, 15, 16, 20, 18, 28, 29, 13, 36, 37, 13, 53, 54, 56, 53, 54, 58, 56, 11, 12, 17, 19, 21, 30, 31, 34, 35, 38, 39, 48, 49, 51, 55, 57, 59, 58, 59, 64, 65, 68, 69, 36, 47, 48, 50, 38, 40, 73, 75, 30, 6, 8, 32, 33, 36, 47, 48, 52, 50, 60, 61, 36, 68, 69, 36, 41, 42, 44, 49, 51, 53, 62, 63, 66, 67, 70, 71, }; 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; } } public static final String[] jjstrLiteralImages = { "", null, null, null, null, "\140", "\140\140", "\74\45\100", "\74\45\41", "\74\152\163\160\72\144\145\143\154\141\162\141\164\151\157\156\76", "\74\45\75", "\74\152\163\160\72\145\170\160\162\145\163\163\151\157\156\76", "\44\173", null, null, null, null, null, null, null, null, null, null, null, null, null, null, "\74\57\152\163\160\72\144\145\143\154\141\162\141\164\151\157\156\76", "\74\57\152\163\160\72\145\170\160\162\145\163\163\151\157\156\76", "\175", null, null, null, null, null, null, null, null, null, null, null, null, null, "\141\142\163\164\162\141\143\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\170\164\145\156\144\163", "\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", "\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\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\171", "\166\157\151\144", "\166\157\154\141\164\151\154\145", "\167\150\151\154\145", "\163\164\162\151\143\164\146\160", "\141\163\163\145\162\164", "\166\141\162", "\146\165\156\143\164\151\157\156", "\145\170\151\164", "\56\56\56", "\156\165\154\154", "\164\162\165\145", "\146\141\154\163\145", "\160\141\147\145", "\151\156\143\154\165\144\145", "\141\156\144", "\145\161", "\147\164", "\157\162", "\155\145", "\154\145", "\145\155\160\164\171", "\156\157\164", "\154\164", "\147\145", "\144\151\166", "\155\157\144", null, null, null, null, null, null, null, null, null, null, null, null, "\173", "\175", "\50", "\51", "\133", "\135", "\73", "\54", "\56", "\140", "\75", "\76", "\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", "\76\76", "\76\76\76", "\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", "\164\150\162\157\167\163", "\54", }; public static final String[] lexStateNames = { "DEFAULT", "NO_PARSE", "JAVA", "JXP", "IN_COMMENT", "IN_SINGLE_LINE_COMMENT", "IN_FORMAL_COMMENT", "IN_MULTI_LINE_COMMENT", }; public static final int[] jjnewLexState = { -1, 2, 2, 1, -1, 2, -1, 3, 2, 2, 3, 3, 3, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 5, 6, 7, 0, 4, 0, 0, 0, 0, 2, 2, 2, -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, 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, }; static final long[] jjtoToken = { 0xfffff8003c003ff1L, 0xe7a3ffffffffffffL, 0x3fffffffffffL, }; static final long[] jjtoSkip = { 0x3fa03ffc00eL, 0x0L, 0x0L, }; static final long[] jjtoSpecial = { 0x3f80000000eL, 0x0L, 0x0L, }; static final long[] jjtoMore = { 0x405c0000000L, 0x0L, 0x0L, }; protected JavaCharStream input_stream; private final int[] jjrounds = new int[76]; private final int[] jjstateSet = new int[152]; StringBuffer image; int jjimageLen; int lengthOfMatch; protected char curChar; public JxpParserTokenManager(JavaCharStream stream) { if (JavaCharStream.staticFlag) throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); input_stream = stream; } public JxpParserTokenManager(JavaCharStream stream, int lexState) { this(stream); SwitchTo(lexState); } public void ReInit(JavaCharStream stream) { jjmatchedPos = jjnewStateCnt = 0; curLexState = defaultLexState; input_stream = stream; ReInitRounds(); } private final void ReInitRounds() { int i; jjround = 0x80000001; for (i = 76; i-- > 0;) jjrounds[i] = 0x80000000; } public void ReInit(JavaCharStream stream, int lexState) { ReInit(stream); SwitchTo(lexState); } public void SwitchTo(int lexState) { if (lexState >= 8 || lexState < 0) throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); else curLexState = lexState; } protected Token jjFillToken() { Token t = Token.newToken(jjmatchedKind); t.kind = jjmatchedKind; String im = jjstrLiteralImages[jjmatchedKind]; t.image = (im == null) ? input_stream.GetImage() : im; t.beginLine = input_stream.getBeginLine(); t.beginColumn = input_stream.getBeginColumn(); t.endLine = input_stream.getEndLine(); t.endColumn = input_stream.getEndColumn(); return t; } int curLexState = 0; int defaultLexState = 0; int jjnewStateCnt; int jjround; int jjmatchedPos; int jjmatchedKind; public Token getNextToken() { int kind; 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 = null; jjimageLen = 0; for (;;) { switch(curLexState) { case 0: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_0(); break; case 1: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_1(); break; case 2: 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_2(); break; case 3: 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_3(); break; case 4: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_4(); if (jjmatchedPos == 0 && jjmatchedKind > 42) { jjmatchedKind = 42; } break; case 5: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_5(); if (jjmatchedPos == 0 && jjmatchedKind > 42) { jjmatchedKind = 42; } break; case 6: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_6(); if (jjmatchedPos == 0 && jjmatchedKind > 42) { jjmatchedKind = 42; } break; case 7: jjmatchedKind = 0x7fffffff; jjmatchedPos = 0; curPos = jjMoveStringLiteralDfa0_7(); if (jjmatchedPos == 0 && jjmatchedKind > 42) { jjmatchedKind = 42; } 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 31 : if (image == null) image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen))); else image.append(input_stream.GetSuffix(jjimageLen)); jjimageLen = 0; input_stream.backup(1); break; default : break; } } void TokenLexicalActions(Token matchedToken) { switch(jjmatchedKind) { case 120 : if (image == null) image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)))); else image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); matchedToken.image = JxpParser.normalizeStringLiteral(image, '\"'); break; case 121 : if (image == null) image = new StringBuffer(new String(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)))); else image.append(input_stream.GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1))); matchedToken.image = JxpParser.normalizeStringLiteral(image, '\''); break; default : break; } } } jxp-1.6.1/src/java/org/onemind/jxp/parser/JxpParserTreeConstants.java100644 0 0 14766 10530435352 23030 0ustar 0 0 /* Generated By:JJTree: Do not edit this line. src/java/org/onemind/jxp/parser\JxpParserTreeConstants.java */ package org.onemind.jxp.parser; public interface JxpParserTreeConstants { public int JJTJXPDOCUMENT = 0; public int JJTVOID = 1; public int JJTCONTENT = 2; public int JJTPRINTSTATEMENT = 3; public int JJTPAGEDIRECTIVE = 4; public int JJTINCLUDEDIRECTIVE = 5; public int JJTSTATICIMPORTDECLARATION = 6; public int JJTIMPORTDECLARATION = 7; public int JJTFIELDDECLARATION = 8; public int JJTVARIABLEDECLARATOR = 9; public int JJTVARIABLEDECLARATORID = 10; public int JJTARRAYINITIALIZER = 11; public int JJTEXITSTATEMENT = 12; public int JJTFUNCTIONDECLARATION = 13; public int JJTFUNCTIONDECLARATOR = 14; public int JJTVARIABLEPARAMETERS = 15; public int JJTFORMALPARAMETERS = 16; public int JJTFORMALPARAMETER = 17; public int JJTTYPE = 18; public int JJTPRIMITIVETYPE = 19; public int JJTNAME = 20; public int JJTNAMELIST = 21; public int JJTASSIGNEXPRESSION = 22; public int JJTMULTIPLYASSIGNEXPRESSION = 23; public int JJTDIVIDEASSIGNEXPRESSION = 24; public int JJTREMASSIGNEXPRESSION = 25; public int JJTPLUSASSIGNEXPRESSION = 26; public int JJTMINUSASSIGNEXPRESSION = 27; public int JJTLSHIFTASSIGNEXPRESSION = 28; public int JJTRSIGNEDSHIFTASSIGNEXPRESSION = 29; public int JJTRUNSIGNEDSHIFTASSIGNEXPRESSION = 30; public int JJTBITWISEANDASSIGNEXPRESSION = 31; public int JJTBITWISEXORASSIGNEXPRESSION = 32; public int JJTBITWISEORASSIGNEXPRESSION = 33; public int JJTHOOKEXPRESSION = 34; public int JJTCONDITIONALOREXPRESSION = 35; public int JJTCONDITIONALANDEXPRESSION = 36; public int JJTBITWISEOREXPRESSION = 37; public int JJTBITWISEXOREXPRESSION = 38; public int JJTBITWISEANDEXPRESSION = 39; public int JJTEQEXPRESSION = 40; public int JJTNEEXPRESSION = 41; public int JJTINSTANCEOFEXPRESSION = 42; public int JJTLTEXPRESSION = 43; public int JJTGTEXPRESSION = 44; public int JJTLEEXPRESSION = 45; public int JJTGEEXPRESSION = 46; public int JJTLSHIFTEXPRESSION = 47; public int JJTRSIGNEDSHIFTEXPRESSION = 48; public int JJTRUNSIGNEDSHIFTEXPRESSION = 49; public int JJTPLUSEXPRESSION = 50; public int JJTMINUSEXPRESSION = 51; public int JJTMULTIPLYEXPRESSION = 52; public int JJTDIVIDEEXPRESSION = 53; public int JJTREMAINDEREXPRESSION = 54; public int JJTUNARYPLUSEXPRESSION = 55; public int JJTUNARYMINUSEXPRESSION = 56; public int JJTPREINCREMENTEXPRESSION = 57; public int JJTPREDECREMENTEXPRESSION = 58; public int JJTBITWISECOMPLEMENTEXPRESSION = 59; public int JJTLOGICALCOMPLEMENTEXPRESSION = 60; public int JJTISEMPTYEXPRESSION = 61; public int JJTPOSTINCREMENTEXPRESSION = 62; public int JJTPOSTDECREMENTEXPRESSION = 63; public int JJTCASTEXPRESSION = 64; public int JJTARRAYREFERENCE = 65; public int JJTMETHODINVOCATION = 66; public int JJTFIELDREFERENCE = 67; public int JJTMETHODCALL = 68; public int JJTFIELD = 69; public int JJTLITERAL = 70; public int JJTARGUMENTS = 71; public int JJTNAMEDARGUMENT = 72; public int JJTARRAYALLOCATIONEXPRESSION = 73; public int JJTOBJECTALLOCATIONEXPRESSION = 74; public int JJTARRAYDIMS = 75; public int JJTLABELEDSTATEMENT = 76; public int JJTBLOCK = 77; public int JJTEMPTYSTATEMENT = 78; public int JJTSWITCHSTATEMENT = 79; public int JJTCASE = 80; public int JJTIFSTATEMENT = 81; public int JJTWHILESTATEMENT = 82; public int JJTDOSTATEMENT = 83; public int JJTENHANCEDFORSTATEMENT = 84; public int JJTFORSTATEMENT = 85; public int JJTFORINIT = 86; public int JJTSTATEMENTEXPRESSIONLIST = 87; public int JJTFORUPDATE = 88; public int JJTBREAKSTATEMENT = 89; public int JJTCONTINUESTATEMENT = 90; public int JJTRETURNSTATEMENT = 91; public int JJTTHROWSTATEMENT = 92; public int JJTSYNCHRONIZEDSTATEMENT = 93; public int JJTTRYSTATEMENT = 94; public int JJTCATCHBLOCK = 95; public int JJTFINALLYBLOCK = 96; public int JJTASSERTSTATEMENT = 97; public String[] jjtNodeName = { "JxpDocument", "void", "Content", "PrintStatement", "PageDirective", "IncludeDirective", "StaticImportDeclaration", "ImportDeclaration", "FieldDeclaration", "VariableDeclarator", "VariableDeclaratorId", "ArrayInitializer", "ExitStatement", "FunctionDeclaration", "FunctionDeclarator", "VariableParameters", "FormalParameters", "FormalParameter", "Type", "PrimitiveType", "Name", "NameList", "AssignExpression", "MultiplyAssignExpression", "DivideAssignExpression", "RemAssignExpression", "PlusAssignExpression", "MinusAssignExpression", "LShiftAssignExpression", "RSignedShiftAssignExpression", "RUnsignedShiftAssignExpression", "BitwiseAndAssignExpression", "BitwiseXOrAssignExpression", "BitwiseOrAssignExpression", "HookExpression", "ConditionalOrExpression", "ConditionalAndExpression", "BitwiseOrExpression", "BitwiseXOrExpression", "BitwiseAndExpression", "EQExpression", "NEExpression", "InstanceOfExpression", "LTExpression", "GTExpression", "LEExpression", "GEExpression", "LShiftExpression", "RSignedShiftExpression", "RUnsignedShiftExpression", "PlusExpression", "MinusExpression", "MultiplyExpression", "DivideExpression", "RemainderExpression", "UnaryPlusExpression", "UnaryMinusExpression", "PreIncrementExpression", "PreDecrementExpression", "BitwiseComplementExpression", "LogicalComplementExpression", "IsEmptyExpression", "PostIncrementExpression", "PostDecrementExpression", "CastExpression", "ArrayReference", "MethodInvocation", "FieldReference", "MethodCall", "Field", "Literal", "Arguments", "NamedArgument", "ArrayAllocationExpression", "ObjectAllocationExpression", "ArrayDims", "LabeledStatement", "Block", "EmptyStatement", "SwitchStatement", "Case", "IfStatement", "WhileStatement", "DoStatement", "EnhancedForStatement", "ForStatement", "ForInit", "StatementExpressionList", "ForUpdate", "BreakStatement", "ContinueStatement", "ReturnStatement", "ThrowStatement", "SynchronizedStatement", "TryStatement", "CatchBlock", "FinallyBlock", "AssertStatement", }; } jxp-1.6.1/src/java/org/onemind/jxp/parser/JxpParserVisitor.java100644 0 0 17561 10530435353 21670 0ustar 0 0 /* Generated By:JJTree: Do not edit this line. src/java/org/onemind/jxp/parser\JxpParserVisitor.java */ package org.onemind.jxp.parser; public interface JxpParserVisitor { public Object visit(SimpleNode node, Object data) throws Exception; public Object visit(AstJxpDocument node, Object data) throws Exception; public Object visit(AstContent node, Object data) throws Exception; public Object visit(AstPrintStatement node, Object data) throws Exception; public Object visit(AstPageDirective node, Object data) throws Exception; public Object visit(AstIncludeDirective node, Object data) throws Exception; public Object visit(AstStaticImportDeclaration node, Object data) throws Exception; public Object visit(AstImportDeclaration node, Object data) throws Exception; public Object visit(AstFieldDeclaration node, Object data) throws Exception; public Object visit(AstVariableDeclarator node, Object data) throws Exception; public Object visit(AstVariableDeclaratorId node, Object data) throws Exception; public Object visit(AstArrayInitializer node, Object data) throws Exception; public Object visit(AstExitStatement node, Object data) throws Exception; public Object visit(AstFunctionDeclaration node, Object data) throws Exception; public Object visit(AstFunctionDeclarator node, Object data) throws Exception; public Object visit(AstVariableParameters node, Object data) throws Exception; public Object visit(AstFormalParameters node, Object data) throws Exception; public Object visit(AstFormalParameter node, Object data) throws Exception; public Object visit(AstType node, Object data) throws Exception; public Object visit(AstPrimitiveType node, Object data) throws Exception; public Object visit(AstName node, Object data) throws Exception; public Object visit(AstNameList node, Object data) throws Exception; public Object visit(AstAssignExpression node, Object data) throws Exception; public Object visit(AstMultiplyAssignExpression node, Object data) throws Exception; public Object visit(AstDivideAssignExpression node, Object data) throws Exception; public Object visit(AstRemAssignExpression node, Object data) throws Exception; public Object visit(AstPlusAssignExpression node, Object data) throws Exception; public Object visit(AstMinusAssignExpression node, Object data) throws Exception; public Object visit(AstLShiftAssignExpression node, Object data) throws Exception; public Object visit(AstRSignedShiftAssignExpression node, Object data) throws Exception; public Object visit(AstRUnsignedShiftAssignExpression node, Object data) throws Exception; public Object visit(AstBitwiseAndAssignExpression node, Object data) throws Exception; public Object visit(AstBitwiseXOrAssignExpression node, Object data) throws Exception; public Object visit(AstBitwiseOrAssignExpression node, Object data) throws Exception; public Object visit(AstHookExpression node, Object data) throws Exception; public Object visit(AstConditionalOrExpression node, Object data) throws Exception; public Object visit(AstConditionalAndExpression node, Object data) throws Exception; public Object visit(AstBitwiseOrExpression node, Object data) throws Exception; public Object visit(AstBitwiseXOrExpression node, Object data) throws Exception; public Object visit(AstBitwiseAndExpression node, Object data) throws Exception; public Object visit(AstEQExpression node, Object data) throws Exception; public Object visit(AstNEExpression node, Object data) throws Exception; public Object visit(AstInstanceOfExpression node, Object data) throws Exception; public Object visit(AstLTExpression node, Object data) throws Exception; public Object visit(AstGTExpression node, Object data) throws Exception; public Object visit(AstLEExpression node, Object data) throws Exception; public Object visit(AstGEExpression node, Object data) throws Exception; public Object visit(AstLShiftExpression node, Object data) throws Exception; public Object visit(AstRSignedShiftExpression node, Object data) throws Exception; public Object visit(AstRUnsignedShiftExpression node, Object data) throws Exception; public Object visit(AstPlusExpression node, Object data) throws Exception; public Object visit(AstMinusExpression node, Object data) throws Exception; public Object visit(AstMultiplyExpression node, Object data) throws Exception; public Object visit(AstDivideExpression node, Object data) throws Exception; public Object visit(AstRemainderExpression node, Object data) throws Exception; public Object visit(AstUnaryPlusExpression node, Object data) throws Exception; public Object visit(AstUnaryMinusExpression node, Object data) throws Exception; public Object visit(AstPreIncrementExpression node, Object data) throws Exception; public Object visit(AstPreDecrementExpression node, Object data) throws Exception; public Object visit(AstBitwiseComplementExpression node, Object data) throws Exception; public Object visit(AstLogicalComplementExpression node, Object data) throws Exception; public Object visit(AstIsEmptyExpression node, Object data) throws Exception; public Object visit(AstPostIncrementExpression node, Object data) throws Exception; public Object visit(AstPostDecrementExpression node, Object data) throws Exception; public Object visit(AstCastExpression node, Object data) throws Exception; public Object visit(AstArrayReference node, Object data) throws Exception; public Object visit(AstMethodInvocation node, Object data) throws Exception; public Object visit(AstFieldReference node, Object data) throws Exception; public Object visit(AstMethodCall node, Object data) throws Exception; public Object visit(AstField node, Object data) throws Exception; public Object visit(AstLiteral node, Object data) throws Exception; public Object visit(AstArguments node, Object data) throws Exception; public Object visit(AstNamedArgument node, Object data) throws Exception; public Object visit(AstArrayAllocationExpression node, Object data) throws Exception; public Object visit(AstObjectAllocationExpression node, Object data) throws Exception; public Object visit(AstArrayDims node, Object data) throws Exception; public Object visit(AstLabeledStatement node, Object data) throws Exception; public Object visit(AstBlock node, Object data) throws Exception; public Object visit(AstEmptyStatement node, Object data) throws Exception; public Object visit(AstSwitchStatement node, Object data) throws Exception; public Object visit(AstCase node, Object data) throws Exception; public Object visit(AstIfStatement node, Object data) throws Exception; public Object visit(AstWhileStatement node, Object data) throws Exception; public Object visit(AstDoStatement node, Object data) throws Exception; public Object visit(AstEnhancedForStatement node, Object data) throws Exception; public Object visit(AstForStatement node, Object data) throws Exception; public Object visit(AstForInit node, Object data) throws Exception; public Object visit(AstStatementExpressionList node, Object data) throws Exception; public Object visit(AstForUpdate node, Object data) throws Exception; public Object visit(AstBreakStatement node, Object data) throws Exception; public Object visit(AstContinueStatement node, Object data) throws Exception; public Object visit(AstReturnStatement node, Object data) throws Exception; public Object visit(AstThrowStatement node, Object data) throws Exception; public Object visit(AstSynchronizedStatement node, Object data) throws Exception; public Object visit(AstTryStatement node, Object data) throws Exception; public Object visit(AstCatchBlock node, Object data) throws Exception; public Object visit(AstFinallyBlock node, Object data) throws Exception; public Object visit(AstAssertStatement node, Object data) throws Exception; } jxp-1.6.1/src/java/org/onemind/jxp/parser/Node.java100644 0 0 2255 10530435354 17232 0ustar 0 0 /* Generated By:JJTree: Do not edit this line. Node.java */ package org.onemind.jxp.parser; /* All AST nodes must implement this interface. It provides basic machinery for constructing the parent and child relationships between nodes. */ public interface Node { /** This method is called after the node has been made the current node. It indicates that child nodes can now be added to it. */ public void jjtOpen(); /** This method is called after all the child nodes have been added. */ public void jjtClose(); /** This pair of methods are used to inform the node of its parent. */ public void jjtSetParent(Node n); public Node jjtGetParent(); /** This method tells the node to add its argument to the node's list of children. */ public void jjtAddChild(Node n, int i); /** This method returns a child node. The children are numbered from zero, left to right. */ public Node jjtGetChild(int i); /** Return the number of children the node has. */ public int jjtGetNumChildren(); /** Accept the visitor. **/ public Object jjtAccept(JxpParserVisitor visitor, Object data) throws Exception; } jxp-1.6.1/src/java/org/onemind/jxp/parser/ParseException.java100644 0 0 16004 10530435355 21314 0ustar 0 0 /* Generated By:JavaCC: Do not edit this line. ParseException.java Version 3.0 */ package org.onemind.jxp.parser; /** * 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 { /** * 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. The boolean flag * "specialConstructor" is also set to true to indicate that this constructor was used to create this object. This constructor * calls its super class with the empty string to force the "toString" method of parent class "Throwable" to print the error * message in the form: ParseException: */ public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, String[] tokenImageVal) { super(""); specialConstructor = true; 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(); specialConstructor = false; } public ParseException(String message) { super(message); specialConstructor = false; } /** * This variable determines which constructor was used to create this object and thereby affects the semantics of the * "getMessage" method (see below). */ protected boolean specialConstructor; /** * 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; /** * This method has the standard behavior when this object has been created using the standard constructors. Otherwise, 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), then this method is called during the * printing of the final stack trace, and hence the correct error message gets displayed. */ public String getMessage() { if (!specialConstructor) { return super.getMessage(); } String expected = ""; 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 += tokenImage[expectedTokenSequences[i][j]] + " "; } if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { expected += "..."; } expected += eol + " "; } 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 += add_escapes(tok.image); 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; 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. */ protected 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(); } }jxp-1.6.1/src/java/org/onemind/jxp/parser/SimpleNode.java100644 0 0 7137 10530435355 20411 0ustar 0 0 /* Generated By:JJTree: Do not edit this line. SimpleNode.java */ package org.onemind.jxp.parser; public class SimpleNode implements Node { protected Node parent; protected Node[] children; protected int id; protected JxpParser parser; //customized code int _dim; int _line, _col; protected Object _data; public SimpleNode(int i) { id = i; } public SimpleNode(JxpParser p, int i) { this(i); parser = p; } public void jjtOpen() { } public void jjtClose() { } public void jjtSetParent(Node n) { parent = n; } public Node jjtGetParent() { return parent; } public void jjtAddChild(Node n, int i) { if (children == null) { children = new Node[i + 1]; } else if (i >= children.length) { Node c[] = new Node[i + 1]; System.arraycopy(children, 0, c, 0, children.length); children = c; } children[i] = n; } public Node jjtGetChild(int i) { return children[i]; } public int jjtGetNumChildren() { return (children == null) ? 0 : children.length; } /** Accept the visitor. **/ public Object jjtAccept(JxpParserVisitor visitor, Object data) throws Exception { return visitor.visit(this, data); } /** Accept the visitor. **/ public Object childrenAccept(JxpParserVisitor visitor, Object data) throws Exception { if (children != null) { for (int i = 0; i < children.length; ++i) { children[i].jjtAccept(visitor, data); } } return data; } /* You can override these two methods in subclasses of SimpleNode to customize the way the node appears when the tree is dumped. If your output uses more than one line you should override toString(String), otherwise overriding toString() is probably all you need to do. */ public String toString() { StringBuffer sb = new StringBuffer(JxpParserTreeConstants.jjtNodeName[id]); if (_data != null) { sb.append(": " + _data); } return sb.toString(); } public String toString(String prefix) { return prefix + toString(); } /* Override this method if you want to customize how the node dumps out its children. */ public void dump(String prefix) { System.out.println(toString(prefix) + " - (" + _line + ", " + _col + ")"); if (children != null) { for (int i = 0; i < children.length; ++i) { SimpleNode n = (SimpleNode) children[i]; if (n != null) { n.dump(prefix + " "); } } } } /** * @return */ public int getCol() { return _col; } /** * @return */ public Object getData() { return _data; } /** * @return */ public int getLine() { return _line; } /** * @param i */ public void setCol(int i) { _col = i; } /** * @param object */ public void setData(Object object) { _data = object; } /** * @param i */ public void setLine(int i) { _line = i; } } jxp-1.6.1/src/java/org/onemind/jxp/parser/Token.java100644 0 0 5276 10530435355 17434 0ustar 0 0 /* Generated By:JavaCC: Do not edit this line. Token.java Version 3.0 */ package org.onemind.jxp.parser; /** * 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(); } } } jxp-1.6.1/src/java/org/onemind/jxp/parser/TokenMgrError.java100644 0 0 11262 10530435355 21124 0ustar 0 0 /* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */ package org.onemind.jxp.parser; public class TokenMgrError extends Error { /* * Ordinals for various reasons why an Error of this type can be thrown. */ /** * Lexical error occured. */ static final int LEXICAL_ERROR = 0; /** * An attempt wass 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 espaced (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 lexicl error curLexState : lexical state in which this error occured errorLine : line * number when the error occured errorColumn : column number when the error occured errorAfter : prefix that was seen before * this error occured 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 ? " " : ("\"" + 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. */ public TokenMgrError() { } public TokenMgrError(String message, int reason) { super(message); errorCode = reason; } 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); } }jxp-1.6.1/src/java/org/onemind/jxp/ProcessingException.java100644 0 0 7343 10530435353 21046 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import org.onemind.jxp.parser.SimpleNode; /** * A processing exception * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class ProcessingException extends Exception { /** the page that has problem * */ private JxpPage _page; /** the error node * */ private SimpleNode _errNode; /** * Constructor * @param page the page that cause the exception * @param message the message */ public ProcessingException(JxpPage page, String message) { super(message); _page = page; } /** * Constructor * @param page the page that cause the exception * @param message the message * @param cause the cause */ public ProcessingException(JxpPage page, String message, Throwable cause) { super(message, cause); _page = page; } /** * Constructor * @param page the page that cause the exception * @param message the message * @param cause the cause * @param errNode the error node */ public ProcessingException(JxpPage page, String message, Throwable cause, SimpleNode errNode) { super(message, cause); _errNode = errNode; _page = page; } /** * Constructor * @param page the page that cause the exception * @param message the message * @param errNode the error node */ public ProcessingException(JxpPage page, String message, SimpleNode errNode) { super(message); _errNode = errNode; _page = page; } /** * Constructor * @param page the page that cause the exception * @param cause the cause * @param errNode the error node */ public ProcessingException(JxpPage page, Throwable cause, SimpleNode errNode) { super(cause); _errNode = errNode; _page = page; } /** * Get the error node * @return the node */ public final SimpleNode getErrNode() { return _errNode; } /** * Set the error node * @param node the node */ public final void setErrNode(SimpleNode node) { _errNode = node; } /** * {@inheritDoc} */ public final String getMessage() { if (_errNode != null) { StringBuffer sb = new StringBuffer(); if (getCause() != null) { sb.append(getCause().getMessage()); } else { sb.append(super.getMessage()); } sb.append(" at " + _page.getName()); sb.append(" line " + _errNode.getLine()); sb.append(", column " + _errNode.getCol()); return sb.toString(); } else { return super.getMessage(); } } }jxp-1.6.1/src/java/org/onemind/jxp/ResourceStreamPageSource.java100644 0 0 5163 10530435352 21771 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.IOException; import java.io.InputStream; import java.net.URL; import org.onemind.commons.java.util.FileUtils; /** * A JxpResourceSource uses resources from classpath as pages * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class ResourceStreamPageSource extends CachingPageSource { /** the prefix * */ private String _pathPrefix; /** * {@inheritDoc} */ public ResourceStreamPageSource(String pathPrefix) { _pathPrefix = pathPrefix; } /** * {@inheritDoc} */ public ResourceStreamPageSource(String pathPrefix, String encoding) { this(pathPrefix); setEncoding(encoding); } /** * Get the path prefix * @return the path prefix */ public final String getPathPrefix() { return _pathPrefix; } /** * {@inheritDoc} */ public final String getStreamName(String pageName) { return FileUtils.concatFilePath(getPathPrefix(), pageName); } /** * Set the pathPrefix * @param pathPrefix The pathPrefix to set. */ public final void setPathPrefix(String pathPrefix) { _pathPrefix = pathPrefix; } /** * {@inheritDoc} */ protected boolean isExpired(CachedJxpPage page) { return false; } /** * {@inheritDoc} */ protected boolean hasStream(String pageName) { return getClass().getResource(getStreamName(pageName)) != null; } /** * {@inheritDoc} */ protected InputStream loadStream(CachedJxpPage page) throws IOException { return getClass().getResourceAsStream(getStreamName(page.getName())); } }jxp-1.6.1/src/java/org/onemind/jxp/servlet/JxpServlet.java100644 0 0 14227 10530435354 20665 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.servlet; import java.io.*; import java.util.*; import java.util.Map; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.*; import org.apache.commons.fileupload.DiskFileUpload; import org.onemind.commons.java.util.*; import org.onemind.jxp.*; import org.xml.sax.SAXException; /** * TODO comment * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class JxpServlet extends HttpServlet { /** the logger **/ private static final Logger _logger = Logger.getLogger(JxpServlet.class.getName()); /** jxp configuration * */ private Properties _config; /** the processor **/ private JxpProcessor _processor; /** the configuration file **/ private String _configFile; /** the upload **/ private DiskFileUpload _uploadRepository; /** * {@inheritDoc} */ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); } /** * Return the config * @return the config */ private Properties getConfig() { return _config; } /** * Get the processor * @param req the request * @return the processor * @throws Exception */ private JxpProcessor getProcessor(HttpServletRequest req) throws Exception { if (_processor == null) { synchronized (this) { if (_processor != null) { return _processor; } if (StringUtils.isNullOrEmpty(_configFile)) { _processor = new JxpProcessor(new JxpContext(new FilePageSource(req.getRealPath("/")))); } else { _processor = JxpFactory.getProcessor(_configFile); } } } return _processor; } /** * {@inheritDoc} */ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { Map env = ServletUtils.getServletEnvironment(getServletConfig()); env.putAll(ServletUtils.getRequestEnvironment(req)); env.putAll(ServletUtils.getExtraRequestEnvironment(req)); Map form = new HashMap(); String uri = req.getRequestURI(); if (uri.endsWith("JxpServlet")) { dumpDebugInfo(req, resp, env); } else { resp.setContentType("text/html"); resp.setStatus(200, "OK"); Writer writer = resp.getWriter(); env.put("form", form); env.put("req", req); env.put("resp", resp); String uripath = StringUtils.substringBeforeLast(uri, "/"); if (uripath == null) { uripath = "/"; } env.put("uripath", uripath); try { form.putAll(ServletUtils.getRequestParameters(req, _uploadRepository)); JxpProcessor processor = getProcessor(req); processor.process(uri, writer, env); } catch (JxpPageNotFoundException pnfe) { _logger.info("Error processing uri" + uripath + ": " + pnfe.getMessage()); writer.write(pnfe.getMessage()); } catch (JxpPageSourceException jpse) { _logger.info("Error processing uri" + uripath + ": " + jpse.getMessage()); writer.write(jpse.getMessage()); } catch (Exception e) { _logger.info("Error processing uri" + uripath); e.printStackTrace(new PrintWriter(writer)); } finally { writer.flush(); } } } /** * Output the debugging information * @param req the request * @param resp the resoibse * @param env the environment * @throws IOException io exceptions */ private void dumpDebugInfo(HttpServletRequest req, HttpServletResponse resp, Map env) throws IOException { resp.setContentType("text/html"); resp.setStatus(200, "OK"); PrintWriter output = resp.getWriter(); output.write("
");
        MapUtils.dump(env, output);
        output.write("
"); output.flush(); output.close(); return; } /** * {@inheritDoc} */ public void init(ServletConfig config) throws ServletException { super.init(config); LogUtils.initLoggingFromClassPath(); _configFile = config.getInitParameter("config"); // create a new file upload handler _uploadRepository = new DiskFileUpload(); // Set upload parameters _uploadRepository.setRepositoryPath(System.getProperty("java.io.tmpdir")); _uploadRepository.setSizeThreshold(1000000); //file > 1 meg write to disk _uploadRepository.setSizeMax(-1); //no maximum size } }jxp-1.6.1/src/java/org/onemind/jxp/StaticVariableAssignable.java100644 0 0 2746 10530435353 21743 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * Represent a static variable for assignment * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class StaticVariableAssignable implements Assignable { /** the variable name **/ private String _name; /** the page **/ private JxpPage _page; /** * Constructor * @param name * @param page */ public StaticVariableAssignable(String name, JxpPage page) { _name = name; _page = page; } /** * {@inheritDoc} */ public Object assign(Object value) { return _page.assignStaticVariable(_name, value); } }jxp-1.6.1/src/java/org/onemind/jxp/util/StaticImport.java100644 0 0 7063 10530435352 20450 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.util; import java.lang.reflect.*; import java.util.*; import java.util.ArrayList; import java.util.List; import org.onemind.commons.invoke.AbstractInvocable; import org.onemind.commons.invoke.AbstractInvocableFunction; /** * StaticImport contains static functions for invocation * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class StaticImport extends AbstractInvocable { /** the class **/ private final Class _class; /** the static fields **/ private Map _staticFields; /** * InvocableFunction which wrap a method * @author TiongHiang Lee (thlee@onemindsoft.org) */ private class StaticFunction extends AbstractInvocableFunction { /** the method **/ private Method _method; /** * Constructor * @param method the method */ public StaticFunction(Method method) { super(method.getName(), method.getParameterTypes()); _method = method; } /** * {@inheritDoc} */ public Object invoke(Object target, Object[] args) throws Exception { return _method.invoke(_class, args); } } /** * Constructor * @param c the class */ public StaticImport(Class c) { _class = c; Method m[] = c.getMethods(); for (int i = 0; i < m.length; i++) { int modifier = m[i].getModifiers(); if ((modifier & Modifier.PUBLIC & Modifier.PUBLIC) > 0) { addFunction(new StaticFunction(m[i])); } } List l = new ArrayList(); Field[] fields = _class.getFields(); for (int i = 0; i < fields.length; i++) { int modifier = fields[i].getModifiers(); if ((modifier & Modifier.PUBLIC & Modifier.PUBLIC) > 0) { try { Object obj = fields[i].get(c); if (_staticFields == null) { _staticFields = new HashMap(); } _staticFields.put(fields[i].getName(), obj); } catch (IllegalAccessException e) { //do nothing about it } } } } /** * Get the static fields * @return the static fields */ public final Map getStaticFields() { if (_staticFields == null) { return Collections.EMPTY_MAP; } else { return Collections.unmodifiableMap(_staticFields); } } }jxp-1.6.1/src/java/org/onemind/jxp/util/StaticImportUtils.java100644 0 0 3513 10530435352 21465 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.util; import java.util.Map; import org.onemind.commons.java.lang.ref.SoftHashMap; /** * Utilities for discovering static imports * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class StaticImportUtils { /** the cache for static import **/ private static Map _cache = new SoftHashMap(100); /** * Constructor */ private StaticImportUtils() { } /** * Get a static import * @param c the class * @return the static import */ public static synchronized StaticImport getStaticImport(Class c) { StaticImport si = (StaticImport) _cache.get(c); if (si == null) { synchronized (c) { si = (StaticImport) _cache.get(c); if (si == null) { si = new StaticImport(c); _cache.put(c, si); } } } return si; } } jxp-1.6.1/src/java/org/onemind/jxp/VariableAssignable.java100644 0 0 3103 10530435355 20561 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * An assignable variable * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class VariableAssignable implements Assignable { /** the name **/ private String _name; /** the context **/ private JxpProcessingContext _context; /** * Constructor * @param name the name * @param context the context */ public VariableAssignable(String name, JxpProcessingContext context) { _name = name; _context = context; } /** * Assign to the value * @param value the value */ public Object assign(Object value) { return _context.getNametableStack().assign(_name, value); } } jxp-1.6.1/src/scripts/jxp.bat100644 0 0 301 10530435355 13173 0ustar 0 0 @echo off set JXP_HOME=%~f0\..\.. java -cp %JXP_HOME%\jxp-1.0.0-beta2.jar;%JXP_HOME%\jars\commons-java-1.2.0.jar;%JXP_HOME%\jars\commons-invoke-1.0.0.jar org.onemind.jxp.JxpProcessor %1 %2 jxp-1.6.1/src/scripts/jxp.sh100644 0 0 404 10530435353 13041 0ustar 0 0 #!/bin/bash export JXP_HOME=`dirname $0`/.. export CLASSPATH="$CLASSPATH:$JXP_HOME/jxp-1.0.0-beta2.jar:$JXP_HOME/jars/log4j-1.2.8.jar:$JXP_HOME/jars/commons-java-1.2.0.jar:$JXP_HOME/jars/commons-invoke-1.0.0.jar" java org.onemind.jxp.JxpProcessor $1 $2 jxp-1.6.1/src/test/log4j.xml100644 0 0 1451 10530435352 12757 0ustar 0 0 jxp-1.6.1/src/test/org/onemind/jxp/ant/build.xml100644 0 0 1776 10530435353 16655 0ustar 0 0 jxp-1.6.1/src/test/org/onemind/jxp/ant/testscript.jxp100644 0 0 4 10530435354 17663 0ustar 0 0 testjxp-1.6.1/src/test/org/onemind/jxp/included/sameLevelInclude.jxp100644 0 0 20 10530435355 21724 0ustar 0 0 <% i = 10; %>jxp-1.6.1/src/test/org/onemind/jxp/included/testInclude.jxp100644 0 0 216 10530435356 21016 0ustar 0 0 <% int i = 0; include("sameLevelInclude.jxp"); assert(i==10); int j = 0; include("/upperLevelInclude.jxp"); assert(j==10); %> jxp-1.6.1/src/test/org/onemind/jxp/jxp-test.xml100644 0 0 1243 10530435356 16542 0ustar 0 0 jxp-1.6.1/src/test/org/onemind/jxp/JxpConfigDigesterTest.java100644 0 0 3247 10530435353 21326 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import junit.framework.TestCase; /** * TODO comment * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class JxpConfigDigesterTest extends TestCase { /** * test loading the multisource page source * @throws Exception if there's problem */ public void testLoadJxpProcessor() throws Exception { JxpProcessor processor = JxpFactory .getProcessor(getClass().getResourceAsStream("/org/onemind/jxp/jxp-test.xml")); JxpPageSource source = processor.getContext().getPageSource(); assertTrue(source instanceof MultiSourcePageSource); MultiSourcePageSource msource = (MultiSourcePageSource) source; assertTrue(msource.getPageSources().size() == 2); assertTrue(processor.getContext().getEnvironment().size()>0); }}jxp-1.6.1/src/test/org/onemind/jxp/JxpProcessorTest.java100644 0 0 14524 10530435355 20433 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import java.io.*; import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; import org.onemind.jxp.parser.ParseException; /** * JxpProcessor unit test * @author TiongHiang Lee (thlee@onemindsoft.org) * */ public class JxpProcessorTest extends TestCase { /** the processor * */ private JxpProcessor _processor; /** the source * */ private JxpPageSource _source; public void setUp() throws Exception { //_source = new ResourceStreamPageSource("/org/onemind/jxp", "UTF-8"); //eclipse bin _source = new FilePageSource("src/test/org/onemind/jxp", "UTF-8"); //eclipse bin _processor = new JxpProcessor(new JxpContext(_source)); _processor.setDoMethodStats(true); } /** test import and declaration * */ public void testImportAndDeclaration() throws Exception { _process("testImportAndDeclaration.jxp"); } /** test the include **/ public void testInclude() throws Exception { _process("/included/testInclude.jxp"); } /** test try statement * */ public void testTry() throws Exception { _process("testTry.jxp"); } /** test switch statement **/ public void testSwitch() throws Exception { _process("testSwitch.jxp"); } /** test function declaration and call **/ public void testFunction() throws Exception { _process("testFunction.jxp"); } /** test function declaration and call **/ public void testJsp() throws Exception { _process("testJsp.jxp"); } /** test statements **/ public void testPrintStatement() throws Exception { Map m = new HashMap(); m.put("test1", "test1"); m.put("test2", "test2"); _process("testPrintStatement.jxp", m); } /** test statements **/ public void testStatements() throws Exception { _process("testStatements.jxp"); } /** test array related operation * */ public void testArray() throws Exception { _process("testArray.jxp"); } /** test misc control flow statements * */ public void testControlFlow() throws Exception { _process("testControlFlow.jxp"); } /** test misc control flow statements * */ public void testStatic() throws Exception { Map m = new HashMap(); m.put("result", new Integer(1)); _process("testStatic.jxp", m); m.put("result", new Integer(2)); _process("testStatic.jxp", m); } /** test operators * */ public void testOperators() throws Exception { _process("testOperators.jxp"); } /** test synchronize * */ public void testSynchronized() throws Exception { _process("testSynchronized.jxp"); } public void testParsing() throws Exception { _process("testParsing.jxp"); } /** test return * */ public void testReturn() throws Exception { _process("testReturn.jxp"); } /** test reflection * */ public void testReflect() throws Exception { _process("testReflect.jxp"); } /** test jdk15 **/ public void testJdk15() throws Exception { _process("testJdk15.jxp"); } public void testBufferedPageSource() throws Exception { ByteArrayPageSource ps = new ByteArrayPageSource(); JxpContext context = new JxpContext(ps); JxpProcessor processor = new JxpProcessor(context); ps.putPageBuffer("test", "<% System.out.println(\"a\"); %> ".getBytes()); processor.process("test", new OutputStreamWriter(System.out)); } public void dumpSyntax(String filename) throws Exception { _source.getJxpPage(filename).getJxpDocument().dump(""); } /** process the given script */ private void _process(String filename) throws Exception { _process(filename, new HashMap()); } /** process the given script */ private void _process(String filename, Map env) throws Exception { Writer writer = new OutputStreamWriter(System.out, "UTF-8"); try { _processor.process(filename, writer, env); } catch (ParseException pe) { throw pe; } catch (Exception e) { System.out.println("Dumping syntax of " + filename); System.out.println(e.getMessage()); // /dumpSyntax(filename); throw e; } finally { writer.flush(); } } public void printMethodStats() { System.out.println(_processor.getMethodStats()); } public static void main(String argsp[]) throws Exception { JxpProcessorTest test = new JxpProcessorTest(); test.setUp(); // test.testArray(); // test.testControlFlow(); // test.testFunction(); // test.testImportAndDeclaration(); // test.testInclude(); // test.testOperators(); // test.testReflect(); // test.testReturn(); // test.testStatements(); // test.testSwitch(); // test.testSynchronized(); // test.testTry(); //test.testPrintStatement(); test.testParsing(); test.printMethodStats(); } }jxp-1.6.1/src/test/org/onemind/jxp/ObjectCreateTest.java100644 0 0 3530 10530435355 20277 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; import junit.framework.TestCase; /** * TODO comment * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class ObjectCreateTest extends TestCase { public void testCreate() { long now = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { Object obj = new Object(); } long then = System.currentTimeMillis(); System.out.println(then - now); now = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { JxpProcessor pro = new JxpProcessor(null); } then = System.currentTimeMillis(); System.out.println(then - now); ThreadLocal t = new ThreadLocal(); Object o = new Object(); now = System.currentTimeMillis(); for (int i = 0; i < 10000; i++) { t.set(o); } then = System.currentTimeMillis(); System.out.println(then - now); } }jxp-1.6.1/src/test/org/onemind/jxp/Static2.java100644 0 0 1735 10530435355 16423 0ustar 0 0 package org.onemind.jxp; /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ public class Static2 { public static int staticVariable; public static void staticMethod(){ } } jxp-1.6.1/src/test/org/onemind/jxp/StaticImportTestClass.java100644 0 0 2267 10530435352 21360 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp; /** * TODO comment * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class StaticImportTestClass { private static int staticPrivateField = 2; public static int staticPublicField = 2; public static void staticPublicMethod() { } private static void staticPrivateMethod() { } }jxp-1.6.1/src/test/org/onemind/jxp/StaticInterface.java100644 0 0 1664 10530435352 20160 0ustar 0 0 package org.onemind.jxp; /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ public interface StaticInterface { public static int staticVariable = 0; } jxp-1.6.1/src/test/org/onemind/jxp/testArray.jxp100644 0 0 421 10530435354 16716 0ustar 0 0 <% var a = new Object[1][4]; assert(a.length==1); assert(a[0].length==4); a[0][0] = 1; assert(a[0][0]==1); var classes = new Class[] { Object.class, Integer.class }; assert(classes[0]==Object.class); var objs = { {'a'}, {'b'}, {'c'} }; %>jxp-1.6.1/src/test/org/onemind/jxp/testControlFlow.jxp100644 0 0 2126 10530435353 20133 0ustar 0 0 <% /** test import **/ //test for int j = 0; for (int i=0; i<10; i++){ j ++; } assert(j==10); //test continue in for j = 0; for (int i=0; i<10; i++){ if (i==0) continue; j++; } assert(j==9); //test break in for j = 0; for (int i=0; i<10; i++){ j++; if (i==8) break; } assert(j==9); //test simple while int i = 0; j = 0; while (i<10){ j++; i++; } assert(j==10); //test continue for while i = 0; j = 0; while (i<10){ i++; if (i==1) continue; j++; } assert(j==9); //test break for while i = 0; j = 0; while (i<10){ i++; if (i==8) break; j++; } assert(j==7); //test simple do...while i = 0; j = 0; do { j++; i++; } while (i<10); assert(j==10); //test continue in do...while i = 0; j = 0; do { i++; if (i==1) continue; j++; } while (i<10); assert(j==9); i = 2; j = 0; /* switch (i){ case 1: j = 1; break; case 2: j = 2; break; case 3: j = 3; break; default: break; } */ %>jxp-1.6.1/src/test/org/onemind/jxp/testFunction.jxp100644 0 0 2240 10530435356 17450 0ustar 0 0 <% //test for simple function invocation int i = 0; function void f1(int arg1){ assert(arg1==10); assert(i==0); //accessing global scope i=100; for (int i=0; i<10; i++){ println(arg1); } }; function Object f2(int i){ return i * 10; } f1(10); assert(i==100); int d = f2(10); assert(d==100); //test for function default function void f2(var check, var a, var b: 2, var c: 3){ println("a=" + a + ", b=" + b + ", c=" + c); switch (check){ case 1: assert(a==1); assert(b==2); assert(c==3); break; case 2: assert(a==1); assert(b==3); assert(c==4); break; case 3: assert(a==1); assert(b==3); assert(c==3); break; case 4: assert(a==1); assert(b==4); assert(c==3); break; } } try { f2(1); //this will fail throw new IllegalStateException("Unit test failed"); } catch (Exception e){ //let it pass } f2(1, 1); //a = 1, b = 2, c = 3 f2(2, 1, 3, 4); //a = 1, b = 3, c = 4 f2(3, 1, 3); //a = 1, b = 3, c = 3 f2(4, 1, c: 3, b: 4); //a = 1, b = 4, c = 3 //f2(4); //invalid, a is required %>jxp-1.6.1/src/test/org/onemind/jxp/testImportAndDeclaration.jxp100644 0 0 1375 10530435352 21732 0ustar 0 0 <% /** test import **/ import java.io.*; File f = new File("test.txt"); /** test declarations **/ int t; assert(t==0); Integer i = new Integer(1); assert(1==i); String a = "Testing delcaration"; assert(a.equals("Testing delcaration")); //** array declarations //not supported yet //String array = new String[] {"a", "b", "c" }; Object simple[] = new Integer[1]; Object[] differentSyntax = new Integer[1][1]; //Object[] initialized = new Integer[] {1}; //not supported //Object[] differentInitialized = { 1 } ; //not supported yet //anArray[0] = intB; //not supported yet /** testing label statement **/ //here: var b = "Testing label"; //** testing block **/ { var c = "Testing block"; } %>jxp-1.6.1/src/test/org/onemind/jxp/testJdk15.jxp100644 0 0 2051 10530435353 16536 0ustar 0 0 <% import static java.lang.Math.*; import static org.onemind.jxp.StaticImportTestClass; import java.util.*; var values[] = { "a", "b", "c" }; //test function from math assert(abs(-1.3f)==1.3); //test methods from test class //staticPrivateMethod(); staticPublicMethod(); //test fields //assert(staticPrivateField==2); assert(staticPublicField==2); //define vararg function function void varargsFunction(Object ... args) { assert(args[0].equals("a")); assert(args[1].equals("b")); assert(args[2].equals("c")); } varargsFunction("a", "b", "c"); //test enhanced for loop int i = 0; for (Object v: Arrays.asList(values)) { switch (i) { case 0: assert(v.equals("a")); break; case 1: assert(v.equals("b")); break; case 2: assert(v.equals("c")); break; } i++; } String propName = "age"; String cPropName = Character.toUpperCase(propName.charAt(0)) + propName.substring(1); println(cPropName); assert(cPropName.equals("Age")); ArrayList a = new ArrayList(); %> jxp-1.6.1/src/test/org/onemind/jxp/testJsp.jxp100644 0 0 720 10530435353 16375 0ustar 0 0 <%-- comment --%> <%@ page import="java.awt.*"%> <%! Button b = new Button("a"); %> Button c = b; <%=b.getLabel()%> c ${b eq c} ${b eq 'a'} Not true ${b eq 'abc'} The label is not empty? ${!empty b.getLabel()} var and = "true"; println(and); println(true && false); println('a'); println("Testing"); <${b}> jxp-1.6.1/src/test/org/onemind/jxp/testOperators.jxp100644 0 0 1345 10530435355 17645 0ustar 0 0 <% /** test operators **/ //declaration Integer one = new Integer(1); Integer two = new Integer(2); //simple operation var onePlusOne = one + one; assert(onePlusOne==2); var oneMinusOne = one - one; assert(oneMinusOne==0); var oneDivideOne = one/one; assert(oneDivideOne==1); var oneTimeTwo = one*two; assert(oneTimeTwo==two); //test precedence var intC = two + one/one*two - two; assert(intC==2); //test boolean var boolD = (3==4 && true || false); assert(boolD==false); var b = Object.class; assert(b==new Object().getClass()); //test casting //assert(((long)1).getClass()==Long.class); assert("a" instanceof String); assert(!("a" instanceof Number)); %>jxp-1.6.1/src/test/org/onemind/jxp/testParsing.jxp100644 0 0 140 10530435353 17240 0ustar 0 0 <% // d¨¦finition g¨¦n¨¦rique de l'application %> d¨¦finition g¨¦n¨¦rique de l'application jxp-1.6.1/src/test/org/onemind/jxp/testPrintStatement.jxp100644 0 0 313 10530435355 20622 0ustar 0 0 ``<`test1` <<%=test1%> <% println("test"); %> `` `test1` <%=test1%><%=test2%> <% char c = '_'; println("tab \t newline \n backslash \\ quote \" ' "); println(c); println(c=='_'); %> jxp-1.6.1/src/test/org/onemind/jxp/testReflect.jxp100644 0 0 177 10530435353 17233 0ustar 0 0 <% /** test reflection **/ new Object().getClass().getName(); print(Static.staticVariable); Static.staticMethod(); %>jxp-1.6.1/src/test/org/onemind/jxp/testReturn.jxp100644 0 0 765 10530435356 17134 0ustar 0 0 <% int i = 0; //test break for (i=0; i<10; i++) { if (i==5) break; } assert(i==5); i = 0; //test break while (i<10){ i++; if (i==5) break; } assert(i==5); //test continue for (i=0; i<10; i++) { if (i==5) continue; if (i==5) break; } assert(i==10); //test continue i = 0; while (i<10){ i++; if (i==5) continue; if (i==5) break; } assert(i==10); function Object test(){ return 1; } assert(test()==1); %>jxp-1.6.1/src/test/org/onemind/jxp/testStatements.jxp100644 0 0 1260 10530435353 20010 0ustar 0 0 <%-- comment --%> <%@ page import="java.math.*,javax.io.*,org.onemind.jxp.StaticInterface,org.onemind.jxp.Static2"%> <% //import java.math.*; //test hook expression int hook = (1==1)?1:2; assert (hook==1); hook = (1==2)?1:2; assert (hook==2); %> <%!! dslkfjdslfjs dds <% skljfdslkjfsdljfsd !!%> <% int b = (Integer)1 + 1; assert(b==2); %> <% println("backslash = \\"); %> <% //test the imports BigDecimal d = new BigDecimal(1); println(Integer.MAX_VALUE); println(Static.staticVariable); Static.staticMethod(); println(Static2.staticVariable); Static2.staticMethod(); println("Interface static = " + StaticInterface.staticVariable); %> A=特 jxp-1.6.1/src/test/org/onemind/jxp/testStatic.jxp100644 0 0 70 10530435356 17051 0ustar 0 0 <% static var a = 1; assert(a==result); a++; %>jxp-1.6.1/src/test/org/onemind/jxp/testSwitch.jxp100644 0 0 1354 10530435353 17126 0ustar 0 0 <% //test case 0 int i = 0; int count = 0; switch (i){ case 0: count = 1; break; case 1: count = 2; break; default: count = 3; break; } assert(count==1); //test case 1 i = 1; switch (i){ case 0: count = 1; break; case 1: count = 2; break; default: count = 3; break; } assert(count==2); //test default case i = 2; switch (i){ case 0: count = 1; break; case 1: count = 2; break; default: count = 3; break; } assert(count==3); //test fall through i = 0; switch (i){ case 0: count = 1; case 1: count = 2; break; default: count = 3; break; } assert(count==2); %>jxp-1.6.1/src/test/org/onemind/jxp/testSynchronized.jxp100644 0 0 140 10530435352 20313 0ustar 0 0 <% int i = 0; Object o = new Object(); synchronized(o) { i++; } assert(i==1); %>jxp-1.6.1/src/test/org/onemind/jxp/testTry.jxp100644 0 0 1057 10530435352 16442 0ustar 0 0 <% /** test import **/ import java.io.*; boolean a = false; try { throw new IOException(""); } catch (FileNotFoundException fe){ } catch (IOException e){ assert(e!=null); a = true; } assert(a==true); a = false; boolean b = false; try { throw new IOException(""); } catch (FileNotFoundException fe){ } catch (IOException e){ a = true; } finally { b = true; } assert(a==true); assert(b==true); try { a = false; } finally { b = false; } assert(a==false); assert(b==false); %>jxp-1.6.1/src/test/org/onemind/jxp/upperLevelInclude.jxp100644 0 0 21 10530435355 20344 0ustar 0 0 <% j = 10; %> jxp-1.6.1/src/test/org/onemind/jxp/util/StaticImportTest.java100644 0 0 2427 10530435355 21350 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ package org.onemind.jxp.util; import junit.framework.TestCase; /** * Static import test * @author TiongHiang Lee (thlee@onemindsoft.org) */ public class StaticImportTest extends TestCase { public void testStaticImport() throws Exception { StaticImport si = StaticImportUtils.getStaticImport(Math.class); //System.out.println(si.getFunctions()); si.invoke("abs", new Object[]{new Float(1.3f)}); } } jxp-1.6.1/src/test/Static.java100644 0 0 1702 10530435353 13310 0ustar 0 0 /* * Copyright (C) 2004 TiongHiang Lee * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Email: thlee@onemindsoft.org */ public class Static { public static int staticVariable; public static void staticMethod(){ } } jxp-1.6.1/src/test/org/onemind/jxp/testStatic.jxp100644 0 0 70 10530435356 17051 0ustar 0 0 <% static var a = 1; assert(a==result); a++; %>jxp-1.6.1/src/test/org/onemind/jxp/testSwitch.jxp100644 0 0 1354 10530435353 17126 0ustar 0 0 <% //test case 0 int i = 0; int count = 0; switch (i){ case 0: count = 1; break; case 1: count = 2; break; default: count = 3; break; } assert(count==1); //test case 1 i = 1; switch (i){ case 0: count = 1; break; case 1: count = 2; break; default: count = 3; break; } assert(count==2); //test default case i = 2; switch (i){ case 0: count = 1; break; case 1: count = 2; break; default: