Examples of SymbolTable


Examples of org.maltparserx.core.symbol.SymbolTable

 
  private void writeElement(PhraseStructureNode element, int depth) throws MaltChainedException {
    try {
      if (element instanceof TokenNode) {
        PhraseStructureNode t = (PhraseStructureNode)element;
        SymbolTable table = null;
        writer.write("\n" + getIndentation(depth) + STARTING_BRACKET);
        int i = 0;
        for (String inputColumn : inputColumns.keySet()) {
          if (i != 0) {
            writer.write(INPUT_SEPARATOR);
          }
          table = inputColumns.get(inputColumn).getSymbolTable();
          if (t.hasLabel(table)) {
            writer.write(encodeString(t.getLabelSymbol(table)));
          }
          if (i == 0) {
            for (String edgeLabelColumn : edgeLabelColumns.keySet()) {
              table = edgeLabelColumns.get(edgeLabelColumn).getSymbolTable();
              if (t.hasParentEdgeLabel(table) && !t.getParent().isRoot() && !t.getParentEdgeLabelSymbol(table).equals(EMPTY_EDGELABEL)) {
                writer.write(EDGELABEL_SEPARATOR);
                writer.write(t.getParentEdgeLabelSymbol(table));
              }
            }
          }
          i++;
        }
        writer.write(CLOSING_BRACKET);
      } else {
        NonTerminalNode nt = (NonTerminalNode)element;
        writer.write("\n" + getIndentation(depth) + STARTING_BRACKET);
        SymbolTable table = null;
        int i = 0;
        for (String phraseLabelColumn : phraseLabelColumns.keySet()) {
          if (i != 0) {
            writer.write(INPUT_SEPARATOR);
          }
View Full Code Here

Examples of org.nfunk.jep.SymbolTable

        {
            jep.setAllowUndeclared(true);
            jep.parseExpression(_expression);

            ArrayList<String> var = new ArrayList<String>();
            SymbolTable tab = jep.getSymbolTable();
            if (tab.get("x") != null)
                var.add("x");
            for (int i=0; i<10; i++)
                if (tab.get("x"+i) != null)
                    var.add("x"+i);
            if (tab.get("y") != null)
                var.add("y");
            for (int i=0; i<10; i++)
                if (tab.get("y"+i) != null)
                    var.add("y"+i);
            if (tab.get("z") != null)
                var.add("z");
            for (int i=0; i<10; i++)
                if (tab.get("z"+i) != null)
                    var.add("z"+i);
            variables = new String[var.size()];
            var.toArray(variables);
        }
        else
View Full Code Here

Examples of org.openquark.cal.compiler.IdentifierResolver.SymbolTable

       
        if (potentialDescendantScope == potentialAncestorScope) {
            return true;
        }
       
        SymbolTable parent = potentialDescendantScope.getParent();
        while (parent instanceof LocalScope) {
            if (parent == potentialAncestorScope) {
                return true;
            }
           
View Full Code Here

Examples of pascalcompiler.parser.SymbolTable

    /**
     * Method used to test a specified file.
     * @param fileName
     */
    public static void testFile(String fileName) {
        SymbolTable idTable = new SymbolTable();
        File input = new File("src\\pascalcompiler\\test\\syntaxtree\\" + fileName);
        PascalParser pp = new PascalParser(input, idTable);
        String syntaxTree = pp.program().indentedToString(0);
        if(pp.isParsable()) {
            System.out.println("Printing syntax tree for " + fileName);
View Full Code Here

Examples of stanfordlogic.gdl.SymbolTable

{
 
  public void testLexer()
  {
    ByteArrayInputStream input = new ByteArrayInputStream( (new String("hello there")).getBytes() );
    SymbolTable symtab = new SymbolTable();
   
    Lexer l = new Lexer(input, symtab);
   
    assertTrue( l.token() > 255 );
    assertTrue( l.token() > 255 );
    assertEquals( -1, l.token() );
   
    assertEquals(2, symtab.size() );
  }
View Full Code Here

Examples of sun.jvm.hotspot.memory.SymbolTable

    // name of the current default stratum
    private String defaultStratum;

    // initialize known class name symbols
    private void initClassNameSymbols() {
        SymbolTable st = saSymbolTable();
        javaLangString = st.probe("java/lang/String");
        javaLangThread = st.probe("java/lang/Thread");
        javaLangThreadGroup = st.probe("java/lang/ThreadGroup");
        javaLangClass = st.probe("java/lang/Class");
        javaLangClassLoader = st.probe("java/lang/ClassLoader");
        javaLangThrowable = st.probe("java/lang/Throwable");
        javaLangObject = st.probe("java/lang/Object");
        javaLangCloneable = st.probe("java/lang/Cloneable");
        javaIoSerializable = st.probe("java/io/Serializable");
        javaLangEnum = st.probe("java/lang/Enum");
    }
View Full Code Here

Examples of symboltable.SymbolTable

   
    public static void main(String[] args){
        Options bean = Options.getInstance();
       
        CmdLineParser clp = new CmdLineParser(bean);
        SymbolTable table = SymbolTable.getInstance();
       
        try{
            clp.parseArgument(args);
        }
        catch(CmdLineException ex){
            if(!bean.getHelp()){
                System.err.println("Error: " + ex.getMessage() + "\nUsage:\n");
                usage(clp);
            }
        }
       
        if(bean.getHelp())
            usage(clp);
        FileSystem fSystem = FileSystems.getDefault();
        boolean specParsed = false;
        ASTSpecWalker walker = new ASTSpecWalker();
        if(bean.printSchema()){
            String inputFile = bean.getSpecInputFile();
           
            try {
                if(clangAST.Driver.parseSpecFile(inputFile) != 0)
                        System.exit(1);
            } catch (IOException ex) {
                System.err.println(ex.getMessage());
                System.exit(1);
            }
           
            String outputFile = table.getClangSpecName() + ".logic";
            Path outputPath = fSystem.getPath(outputFile);
           
            try (BufferedWriter writer = Files.newBufferedWriter(outputPath, StandardCharsets.UTF_8);){
               
                walker.walk(new PrintLogicQLSchema(writer));
                specParsed = true;
            }
            catch(IOException ex){
                System.err.println(ex.getMessage());
                System.exit(1);
            }
        }
       
        if(bean.createPlugin()){
            try {
                if(!specParsed){
                    if(clangAST.Driver.parseSpecAndAuxFile(bean.getSpecInputFile(), bean.getAuxInputFile()) != 0)
                        System.exit(1);
                }
                else {
                    if(clangAST.Driver.parseAuxFile(bean.getAuxInputFile()) != 0)
                        System.exit(1);
                }
               
                String outputFilename = table.getClangSpecName() + ".h";
                Path outputFile = fSystem.getPath(outputFilename);
               
                try(BufferedWriter writer = Files.newBufferedWriter(outputFile, StandardCharsets.UTF_8);){
                    walker.walk(new PrintClangCsvPlugin(writer));
                }

            } catch (IOException ex) {
                System.err.println(ex.getMessage());
                System.exit(1);
            }
        }
       
        if(bean.genImportCode()){
            try{
                if(!specParsed){
                    if(clangAST.Driver.parseSpecFile(bean.getSpecInputFile()) != 0)
                        System.exit(1);
                }
               
                String outputFilename = table.getClangSpecName() + "-import.logic";
                Path outputFile = fSystem.getPath(outputFilename);
               
                try(BufferedWriter writer = Files.newBufferedWriter(outputFile, StandardCharsets.UTF_8);){
                    Path csvOutDir = bean.getCsvOutDir();
                    if(Files.exists(csvOutDir)){
View Full Code Here

Examples of xtc.util.SymbolTable

   *
   * @param runt The runtime.
   */
  public Analyzer(Runtime runt) {
    runtime = runt;
    gamma = new SymbolTable();
    hashTable = new Hashtable<Object, Object>();
    getScopeNodes();   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.