Skip to content

Commit

Permalink
executors/ALGL68: add Algol 68 Genie executor
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyene committed May 26, 2024
1 parent c72b8c1 commit dfa1359
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions dmoj/executors/ALGL68.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from typing import List

from dmoj.cptbox.handlers import ACCESS_EACCES
from dmoj.executors.compiled_executor import CompiledExecutor


class Executor(CompiledExecutor):
ext = 'a'
command = 'a68g'

test_program = '''
BEGIN
STRING input;
get(standin, input);
print((input, newline))
END
'''

data_grace = 131072
syscalls = [('mkdir', ACCESS_EACCES), 'alarm']

def get_compile_args(self) -> List[str]:
command = self.get_command()
assert command is not None
assert self._code is not None
# This doesn't actually compile anything, but will generate useful
# output if the program is malformed.
return [command, '--norun', '--noportcheck', '--nopragmats', self._code]

def get_cmdline(self, **kwargs) -> List[str]:
command = self.get_command()
assert command is not None
assert self._code is not None
return [command, '--nowarnings', '--noportcheck', '--nopragmats', self._code]

def get_executable(self):
return self.get_command()

0 comments on commit dfa1359

Please sign in to comment.