All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jaxx.compiler.SymbolTable Maven / Gradle / Ivy

There is a newer version: 3.0-alpha-6
Show newest version
/*
 * #%L
 * JAXX :: Compiler
 * 
 * $Id: SymbolTable.java 2225 2011-02-19 20:15:00Z tchemit $
 * $HeadURL: http://svn.nuiton.org/svn/jaxx/tags/jaxx-2.5.27/jaxx-compiler/src/main/java/jaxx/compiler/SymbolTable.java $
 * %%
 * Copyright (C) 2008 - 2010 CodeLutin
 * %%
 * This program 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 3 of the 
 * License, or (at your option) any later version.
 * 
 * This program 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 General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public 
 * License along with this program.  If not, see
 * .
 * #L%
 */

package jaxx.compiler;

import jaxx.compiler.reflect.FieldDescriptor;
import jaxx.compiler.reflect.MethodDescriptor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/** Symbol table constructed during the first pass of compilation. */
public class SymbolTable {

    private String superclass;
    // maps ID strings to class names -- we can't map directly to CompiledObjects, because we
    // can't create those until after the first pass

    private Map ids = new HashMap();

    private List scriptFields = new ArrayList();

    private List scriptMethods = new ArrayList();

    private String[] interfaces;

    /** @return the fully-qualified name of the superclass of the class described by this symbol table. */
    public String getSuperclassName() {
        return superclass;
    }

    public String[] getInterfaces() {
        return interfaces;
    }

    public void setSuperclassName(String superclass) {
        this.superclass = superclass;
    }

    /**
     * @return a map of IDs to class names.  Each entry in the map corresponds to a class tag with an
     *         id attribute.  The id is the key, and the fully-qualified class name
     *         of the tag is the value.
     */
    public Map getClassTagIds() {
        return ids;
    }

    /** @return a list of FieldDescriptors for fields defined in <script> tags. */
    public List getScriptFields() {
        return scriptFields;
    }

    /** @return a list of MethodDescriptors for methods defined in <script> tags. */
    public List getScriptMethods() {
        return scriptMethods;
    }

    public void setInterfaces(String[] interfaces) {
        this.interfaces = interfaces;
    }

    public void clear() {
        ids.clear();
        scriptFields.clear();
        scriptMethods.clear();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy