Exemple #1
0
from backend import BackendBase, registry

class GCCBackend(BackendBase):
    def compile(self, argv=None, env={}):
        if not argv: argv = ['gcc', 'main.c']
        return self.popen(argv, env)

    def run(self, argv=None, env={}):
        if not argv: argv = ['./a.out']
        return self.popen(argv, env)

registry.append({
    'name': 'gcc',
    'class': GCCBackend,
    'description': 'The GNU C compiler'
})

Exemple #2
0
from backend import BackendBase, registry


class HaskellBackend(BackendBase):
    def compile(self, argv=None, env={}):
        if not argv: argv = ['ghc', 'main.hs']
        return self.popen(argv, env)

    def run(self, argv=None, env={}):
        if not argv: argv = ['./main']
        return self.popen(argv, env)


registry.append({
    'name': 'haskell',
    'class': HaskellBackend,
    'description': 'the purely-functional programming language'
})
Exemple #3
0
from backend import BackendBase, registry

class ClojureBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['clojure', 'main.clj']
        return self.popen(argv, env)

registry.append({
    'name': 'clojure',
    'class': ClojureBackend,
    'description': 'the jvm lisp'
})


Exemple #4
0
from backend import BackendBase, registry


class GCCBackend(BackendBase):
    def compile(self, argv=None, env={}):
        if not argv: argv = ['gcc', 'main.c']
        return self.popen(argv, env)

    def run(self, argv=None, env={}):
        if not argv: argv = ['./a.out']
        return self.popen(argv, env)


registry.append({
    'name': 'gcc',
    'class': GCCBackend,
    'description': 'The GNU C compiler'
})
Exemple #5
0
from backend import BackendBase, registry

class Python3Backend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['python3', 'main.py']
        return self.popen(argv, env)

registry.append({
    'name': 'python3',
    'class': Python3Backend,
    'description': 'the general-purpose language'
})


Exemple #6
0
from backend import BackendBase, registry


class RubyBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['ruby', 'main.rb']
        return self.popen(argv, env)


registry.append({
    'name': 'ruby',
    'class': RubyBackend,
    'description': 'the dynamic scripting language'
})
Exemple #7
0
from backend import BackendBase, registry

class JavaBackend(BackendBase):
    def compile(self, argv=None, env={}):
        if not argv: argv = ['javac', 'Main.java']
        return self.popen(argv, env)

    def run(self, argv=None, env={}):
        if not argv: argv = ['java', 'Main']
        return self.popen(argv, env)

registry.append({
    'name': 'java',
    'class': JavaBackend,
    'description': 'the cross-platform language'
})


Exemple #8
0
from backend import BackendBase, registry

class BashBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['/bin/bash', 'main.sh']
        return self.popen(argv, env)

registry.append({
    'name': 'bash',
    'class': BashBackend,
    'description': 'the bash shell'
})


Exemple #9
0
from backend import BackendBase, registry

class TCLBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['tclsh', 'main.tcl']
        return self.popen(argv, env)

registry.append({
    'name': 'tcl',
    'class': TCLBackend,
    'description': 'the tool command language'
})


Exemple #10
0
from backend import BackendBase, registry

class PerlBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['perl', 'main.pl']
        return self.popen(argv, env)

registry.append({
    'name': 'perl',
    'class': PerlBackend,
    'description': 'the general-purpose dynamic programming language'
})


Exemple #11
0
from backend import BackendBase, registry


class ScalaBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['scala', 'main.sc']
        return self.popen(argv, env)


registry.append({
    'name': 'scala',
    'class': ScalaBackend,
    'description': 'the functional jvm language'
})
Exemple #12
0
from backend import BackendBase, registry


class PHPBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['php', 'main.php']
        return self.popen(argv, env)


registry.append({
    'name': 'php',
    'class': PHPBackend,
    'description': 'personal homepage language'
})
Exemple #13
0
from backend import BackendBase, registry


class JavaScriptBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['node', 'main.js']
        return self.popen(argv, env)


registry.append({
    'name': 'javascript',
    'class': JavaScriptBackend,
    'description': 'nodejs'
})
Exemple #14
0
from backend import BackendBase, registry

class RubyBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['ruby', 'main.rb']
        return self.popen(argv, env)

registry.append({
    'name': 'ruby',
    'class': RubyBackend,
    'description': 'the dynamic scripting language'
})


Exemple #15
0
from backend import BackendBase, registry


class ClojureBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['clojure', 'main.clj']
        return self.popen(argv, env)


registry.append({
    'name': 'clojure',
    'class': ClojureBackend,
    'description': 'the jvm lisp'
})
Exemple #16
0
from backend import BackendBase, registry

class JavaScriptBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['node', 'main.js']
        return self.popen(argv, env)

registry.append({
    'name': 'javascript',
    'class': JavaScriptBackend,
    'description': 'nodejs'
})


Exemple #17
0
from backend import BackendBase, registry

class PHPBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['php', 'main.php']
        return self.popen(argv, env)

registry.append({
    'name': 'php',
    'class': PHPBackend,
    'description': 'personal homepage language'
})


Exemple #18
0
from backend import BackendBase, registry


class BashBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['/bin/bash', 'main.sh']
        return self.popen(argv, env)


registry.append({
    'name': 'bash',
    'class': BashBackend,
    'description': 'the bash shell'
})
Exemple #19
0
from backend import BackendBase, registry


class GoBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['go', 'run', 'main.go']
        return self.popen(argv, env)


registry.append({'name': 'go', 'class': GoBackend, 'description': 'go'})
Exemple #20
0
from backend import BackendBase, registry


class JavaBackend(BackendBase):
    def compile(self, argv=None, env={}):
        if not argv: argv = ['javac', 'Main.java']
        return self.popen(argv, env)

    def run(self, argv=None, env={}):
        if not argv: argv = ['java', 'Main']
        return self.popen(argv, env)


registry.append({
    'name': 'java',
    'class': JavaBackend,
    'description': 'the cross-platform language'
})
Exemple #21
0
from backend import BackendBase, registry

class CPPBackend(BackendBase):
    def compile(self, argv=None, env={}):
        if not argv: argv = ['g++', 'main.cpp']
        return self.popen(argv, env)

    def run(self, argv=None, env={}):
        if not argv: argv = ['./a.out']
        return self.popen(argv, env)

registry.append({
    'name': 'cpp',
    'class': CPPBackend,
    'description': 'The GNU C++ compiler'
})

Exemple #22
0
from backend import BackendBase, registry

class CommonLispBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['gcl', '-batch', '-load', 'main.lisp']
        return self.popen(argv, env)

registry.append({
    'name': 'commonlisp',
    'class': CommonLispBackend,
    'description': 'the modern lisp'
})


Exemple #23
0
Fichier : go.py Projet : 4poc/rccvm
from backend import BackendBase, registry

class GoBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['go', 'run', 'main.go']
        return self.popen(argv, env)

registry.append({
    'name': 'go',
    'class': GoBackend,
    'description': 'go'
})


Exemple #24
0
from backend import BackendBase, registry


class Python2Backend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['python2', 'main.py']
        return self.popen(argv, env)


registry.append({
    'name': 'python2',
    'class': Python2Backend,
    'description': 'the general-purpose language'
})
Exemple #25
0
from backend import BackendBase, registry


class PerlBackend(BackendBase):
    def compile(self, argv=None, env={}):
        pass

    def run(self, argv=None, env={}):
        if not argv: argv = ['perl', 'main.pl']
        return self.popen(argv, env)


registry.append({
    'name':
    'perl',
    'class':
    PerlBackend,
    'description':
    'the general-purpose dynamic programming language'
})