-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executors/ALGL68: add Algol 68 Genie executor
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |