Package abstrasy

Examples of abstrasy.SourceFile


    private final void _loadSource(File fln) {
        String fname = fln.getAbsolutePath();
        System.out.println("Load " + fname);
        try {
            SourceFile sfile = new SourceFile(fname);
            sfile.load();
            jTextArea1.setText(sfile.getSource());
            referenceSource_ = jTextArea1.getText();
            jTextArea1.setCaretPosition(0);
            jTextArea1.forceColorize();
            jTextArea2.append(fln + " loaded...\n");
            this.setActualFile(fname);
View Full Code Here


                    cont =
(JOptionPane.showConfirmDialog(this, "The file " + fname + "\nalready exists...\nOverwrite it?", "Existing file...", JOptionPane.YES_NO_OPTION) ==
JOptionPane.YES_OPTION);
                }
                if (cont) {
                    SourceFile sfile = new SourceFile(fname);
                    sfile.setSource(jTextArea1.getText());
                    sfile.save();
                    referenceSource_ = jTextArea1.getText();
                    jTextArea2.append(fln + " saved...\n");
                    this.setActualFile(fname);
                }
                else {
View Full Code Here

        // chercher le fichier...
        File src = SourceFile.findSourceFileName(npath.getString());
       
        // c'est parti!...
        String msrc = "";
        SourceFile in = null;

        if (src != null) {
            in = new SourceFile(src.getAbsolutePath());
        }
        else {
            Node iPaths = Heap.getv(ASymbol.SYMBOL_IMPORTS_PATH);
            if (iPaths != null) {
                if (iPaths.getQType()==Node.TYPE_CLIST) {
                    for (int ip = (iPaths.size() - 1); ip >= 0; ip--) {
                        Node pval = iPaths.elementAt(ip);
                        if (pval.isString()) {
                            src = SourceFile.findSourceFileName(pval.getString() + npath.getString());
                            if (src != null) {
                                in = new SourceFile(src.getAbsolutePath());
                                ip = -1;
                            }
                        }
                    }
                }
            }
        }
        if (in == null) {
            Node iPaths = Heap.getv(ASymbol.SYMBOL_IMPORTS_BASE_URL);
            if (iPaths != null) {
                if (iPaths.getQType()==Node.TYPE_CLIST) {
                    for (int ip = (iPaths.size() - 1); ip >= 0; ip--) {
                        Node pval = iPaths.elementAt(ip);
                        if (pval.isString()) {
                            URL surl = SourceFile.findSourceURLName(pval.getString() + npath.getString());
                            if (surl != null) {
                                in = new SourceFile(surl);
                                ip = -1;
                            }
                        }
                    }
                }
            }

        }
        if (in != null) {
            try {
                in.load();
                msrc = in.getSource();
                Interpreter interpreter = Interpreter.interpr_getNewChildInterpreter();
                //Register continue dans le même thread...
                Heap.push(); // mais en créant une closure
                interpreter.setSource(msrc);
                interpreter.compile();
View Full Code Here

        }


        File src = SourceFile.findSourceFileName(npath);
        String msrc = "";
        SourceFile in = null;

        if (src != null) {
            in = new SourceFile(src.getAbsolutePath());
        }
        else {
            Node iPaths = Heap.getv(ASymbol.SYMBOL_IMPORTS_PATH);
            if (iPaths != null) {
                if (iPaths.getQType()==Node.TYPE_CLIST) {
                    for (int ip = (iPaths.size() - 1); ip >= 0; ip--) {
                        Node pval = iPaths.elementAt(ip);
                        if (pval.isString()) {
                            src = SourceFile.findSourceFileName(pval.getString() + npath);
                            if (src != null) {
                                in = new SourceFile(src.getAbsolutePath());
                                ip = -1;
                            }
                        }
                    }
                }
            }
        }
        if (in == null) {
            Node iPaths = Heap.getv(ASymbol.SYMBOL_IMPORTS_BASE_URL);
            if (iPaths != null) {
                if (iPaths.getQType()==Node.TYPE_CLIST) {
                    for (int ip = (iPaths.size() - 1); ip >= 0; ip--) {
                        Node pval = iPaths.elementAt(ip);
                        if (pval.isString()) {
                            URL surl = SourceFile.findSourceURLName(pval.getString() + npath);
                            if (surl != null) {
                                in = new SourceFile(surl);
                                ip = -1;
                            }
                        }
                    }
                }
            }

        }
        if (in != null) {
            try {
                in.load();
                msrc = in.getSource();
                Interpreter interpreter = Interpreter.interpr_getNewChildInterpreter();
                //Register continue dans le même thread...
                Heap.push(); // mais en créant une closure
                interpreter.setSource(msrc);
                interpreter.compile();
View Full Code Here

TOP

Related Classes of abstrasy.SourceFile

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.