Package pascalcompiler.parser

Examples of pascalcompiler.parser.IdInformation


    public String writeCodeForRoot( ProgramNode root, SymbolTable idTable) {
        String a = null;
        String result = "";
        table = idTable;
        StringBuilder code = new StringBuilder();
        IdInformation element;
        result += String.format("%-20s%s", "newLine"+":", ".asciiz  \"\\n\"\n");
        Enumeration e = idTable.getTable().elements();
        //Writes global variables to .data section (all variables are global)
        while (e.hasMoreElements()) {
            element = (IdInformation)e.nextElement();
            if (element.getKind() == PascalToken.VAR) {
                result += String.format("%-20s%s", element.getName()+":", ".word    0\n");
            }
        }
        code.append("#Program Name: " + root.getName() + "\n");
        code.append(".data \n");
        code.append(result);
View Full Code Here

TOP

Related Classes of pascalcompiler.parser.IdInformation

Copyright © 2018 www.massapicom. 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.