language

package
v0.0.0-...-1388524 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package language contains definitions of all the languages that the judge supports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLanguages

func GetLanguages() map[string]*Language

GetLanguages returns all installed languages, mapped from language ID to the language itself.

func GuessLanguage

func GuessLanguage(p *runpb.Program) error

GuessLanguage tries to detect the language of the given uncompiled program.

func Init

func Init() error

func TagName

func TagName(group runpb.LanguageGroup) string

Types

type CompileFunc

type CompileFunc func(program *runpb.Program, outputPath string, client execpb.ExecuteServiceClient) (*compilers.Compilation, error)

CompileFunc is a function used to compile a program into the given path. It may use calls to the execution service in order to perform the compilation.

type Language

type Language struct {
	// An identifier for this language.
	// This is suitable for inclusion in URLs, and can be displayed externally.
	Id string

	// The language (runtime or compiler) version that this language belongs to.
	Version string

	// The language group that this language belongs to.
	LanguageGroup runpb.LanguageGroup

	// The compile function that should be used to compile programs of this language.
	Compile CompileFunc

	// The run function that should be used to run compiled programs of this language.
	Program runners.RunFunc
}

Language represents a programming language.

func GetLanguage

func GetLanguage(id string) (lang *Language, found bool)

GetLanguage returns the language with the given id. The second parameter designates whether a language with this ID existed.

func (*Language) ToApiLanguage

func (l *Language) ToApiLanguage() *runpb.Language

ToApiLanguage converts the internal language to the external API representaiton.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL