YukiHelper.Language behaviour (YukiHelper v0.2.0) View Source

Provides a module to verify compiler, compile and, execute compiled target.

Link to this section Summary

Types

Path of compiler.

Any error.

Execution time.

Content of ouptput file.

Extension of source file.

Path of input file.

Atom value which specifies language.

Message which occurred on compiling.

A list of language module.

A list of option.

Result when execute compiled target.

Path of source file.

Status which judge the answer.

Filename of testcase

Functions

Cleans up objects (executable files etc.) depending on each language.

Returns currnet language module

Returns a list of language module

Returns primary language module

Runs compiled target and returns status and execution time.

Verifies that the language is supported and its executable compiler exists.

Callbacks

Returns the message and status code when the source code was compiled.

Returns the path of the compiler if there is valid compiler.

Returns extension of the language.

Returns whether the language module does handling or not.

Returns atom value which of the language is handled by the module.

Returns the results when the compiled target was executed.

Link to this section Types

Specs

compiler() :: Path.t()

Path of compiler.

Specs

error() :: term()

Any error.

Specs

exec_time() :: non_neg_integer()

Execution time.

Specs

expect() :: String.t()

Content of ouptput file.

Specs

extension() :: String.t()

Extension of source file.

Specs

input() :: Path.t()

Path of input file.

Specs

language() :: atom()

Atom value which specifies language.

Specs

message() :: String.t()

Message which occurred on compiling.

Specs

modules() :: [module()]

A list of language module.

Specs

opts() :: keyword()

A list of option.

Specs

result() :: String.t()

Result when execute compiled target.

Specs

source() :: Path.t()

Path of source file.

Specs

status() :: :time_limit | :wrong_answer | :runtime_error | :accept

Status which judge the answer.

Specs

testcase() :: String.t()

Filename of testcase

Link to this section Functions

Specs

clean_up(YukiHelper.Config.t(), opts()) :: :ok | :error

Cleans up objects (executable files etc.) depending on each language.

Link to this function

compile(config, source, opts)

View Source

Specs

compile(YukiHelper.Config.t(), source(), opts()) ::
  {:ok, String.t()} | {:error, term()}

Specs

Returns currnet language module

Specs

languages() :: modules()

Returns a list of language module

Specs

primary(YukiHelper.Config.t()) :: module()

Returns primary language module

Link to this function

run(config, no, testcase, source, opts)

View Source

Specs

Runs compiled target and returns status and execution time.

Specs

verify(YukiHelper.Config.t(), keyword()) ::
  {:ok, language(), compiler()} | {:error, term()}

Verifies that the language is supported and its executable compiler exists.

Specs

verify!(YukiHelper.Config.t(), keyword()) :: {language(), compiler()}

Link to this section Callbacks

Specs

clean_up() :: :ok | :error
Link to this callback

compile(arg1, source, opts)

View Source

Specs

compile(YukiHelper.Config.t(), source(), opts()) ::
  {message(), 0} | {message(), 1}

Returns the message and status code when the source code was compiled.

Specs

compiler(YukiHelper.Config.t(), opts()) :: {:ok, compiler()} | {:error, error()}

Returns the path of the compiler if there is valid compiler.

Specs

ext() :: extension()

Returns extension of the language.

Specs

handle?(YukiHelper.Config.t(), opts()) :: boolean()

Returns whether the language module does handling or not.

Specs

me() :: language()

Returns atom value which of the language is handled by the module.

Link to this callback

run(arg1, arg2, source, input, opts)

View Source

Specs

Returns the results when the compiled target was executed.