deer_compiler

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

GCC Compiler Provider * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

Golang Compiler Provider * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

Java Compiler Provider * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

Compiler Provider Base * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

NodeJS Compiler Provider * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

PHP Compiler Provider * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

Python Compiler Provider * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

Ruby Compiler Provider * (C) 2019 LanceLRQ * * This code is licenced under the GPLv3.

Index

Constants

View Source
const (
	COMPILE_COMMAND_GNUC   = "/usr/bin/gcc %s -o %s -ansi -fno-asm -Wall -std=c11 -lm"
	COMPILE_COMMAND_GNUCPP = "/usr/bin/g++ %s -o %s -ansi -fno-asm -Wall -lm -std=c++11"
	COMPILE_COMMAND_JAVA   = "/usr/bin/javac -encoding utf-8 %s -d %s"
	COMPILE_COMMAND_GO     = "/usr/bin/go build -o %s %s"
	COMPILE_COMMAND_NODEJS = "/usr/bin/node -c %s"
	COMPILE_COMMAND_PHP    = "/usr/bin/php -l -f %s"
	COMPILE_COMMAND_RUBY   = "/usr/bin/ruby -c %s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeCompileProvider

type CodeCompileProvider struct {
	CodeCompileProviderInterface
	// contains filtered or unexported fields
}

func (*CodeCompileProvider) IsReady

func (prov *CodeCompileProvider) IsReady() bool

func (*CodeCompileProvider) IsRealTime

func (prov *CodeCompileProvider) IsRealTime() bool

type CodeCompileProviderInterface

type CodeCompileProviderInterface interface {
	// 初始化
	Init(code string, workDir string) error

	// 编译程序
	Compile() (result bool, errmsg string)
	// 获取程序的运行命令参数组
	GetRunArgs() (args []string)
	// 判断STDERR的输出内容是否存在编译错误信息,通常用于脚本语言的判定,
	IsCompileError(remsg string) bool
	// 是否为实时编译的语言
	IsRealTime() bool
	// 是否已经编译完毕
	IsReady() bool
	// contains filtered or unexported methods
}

type GnucCompileProvider

type GnucCompileProvider struct {
	CodeCompileProvider
}

func (*GnucCompileProvider) Compile

func (prov *GnucCompileProvider) Compile() (result bool, errmsg string)

func (*GnucCompileProvider) GetRunArgs

func (prov *GnucCompileProvider) GetRunArgs() (args []string)

func (*GnucCompileProvider) Init

func (prov *GnucCompileProvider) Init(code string, workDir string) error

func (*GnucCompileProvider) IsCompileError added in v1.1.8

func (prov *GnucCompileProvider) IsCompileError(remsg string) bool

type GnucppCompileProvider

type GnucppCompileProvider struct {
	CodeCompileProvider
}

func (*GnucppCompileProvider) Compile

func (prov *GnucppCompileProvider) Compile() (result bool, errmsg string)

func (*GnucppCompileProvider) GetRunArgs

func (prov *GnucppCompileProvider) GetRunArgs() (args []string)

func (*GnucppCompileProvider) Init

func (prov *GnucppCompileProvider) Init(code string, workDir string) error

func (*GnucppCompileProvider) IsCompileError added in v1.1.8

func (prov *GnucppCompileProvider) IsCompileError(remsg string) bool

type GolangCompileProvider

type GolangCompileProvider struct {
	CodeCompileProvider
}

func (*GolangCompileProvider) Compile

func (prov *GolangCompileProvider) Compile() (result bool, errmsg string)

func (*GolangCompileProvider) GetRunArgs

func (prov *GolangCompileProvider) GetRunArgs() (args []string)

func (*GolangCompileProvider) Init

func (prov *GolangCompileProvider) Init(code string, workDir string) error

func (*GolangCompileProvider) IsCompileError added in v1.1.8

func (prov *GolangCompileProvider) IsCompileError(remsg string) bool

type JavaCompileProvider

type JavaCompileProvider struct {
	CodeCompileProvider
	// contains filtered or unexported fields
}

func (*JavaCompileProvider) Compile

func (prov *JavaCompileProvider) Compile() (result bool, errmsg string)

func (*JavaCompileProvider) GetRunArgs

func (prov *JavaCompileProvider) GetRunArgs() (args []string)

func (*JavaCompileProvider) Init

func (prov *JavaCompileProvider) Init(code string, workDir string) error

func (*JavaCompileProvider) IsCompileError added in v1.1.8

func (prov *JavaCompileProvider) IsCompileError(remsg string) bool

type NodeJSCompileProvider

type NodeJSCompileProvider struct {
	CodeCompileProvider
}

func (*NodeJSCompileProvider) Compile

func (prov *NodeJSCompileProvider) Compile() (result bool, errmsg string)

func (*NodeJSCompileProvider) GetRunArgs

func (prov *NodeJSCompileProvider) GetRunArgs() (args []string)

func (*NodeJSCompileProvider) Init

func (prov *NodeJSCompileProvider) Init(code string, workDir string) error

func (*NodeJSCompileProvider) IsCompileError

func (prov *NodeJSCompileProvider) IsCompileError(remsg string) bool

type PHPCompileProvider

type PHPCompileProvider struct {
	CodeCompileProvider
}

func (*PHPCompileProvider) Compile

func (prov *PHPCompileProvider) Compile() (result bool, errmsg string)

func (*PHPCompileProvider) GetRunArgs

func (prov *PHPCompileProvider) GetRunArgs() (args []string)

func (*PHPCompileProvider) Init

func (prov *PHPCompileProvider) Init(code string, workDir string) error

func (*PHPCompileProvider) IsCompileError

func (prov *PHPCompileProvider) IsCompileError(remsg string) bool

type Py2CompileProvider

type Py2CompileProvider struct {
	CodeCompileProvider
}

func (*Py2CompileProvider) Compile

func (prov *Py2CompileProvider) Compile() (result bool, errmsg string)

func (*Py2CompileProvider) GetRunArgs

func (prov *Py2CompileProvider) GetRunArgs() (args []string)

func (*Py2CompileProvider) Init

func (prov *Py2CompileProvider) Init(code string, workDir string) error

func (*Py2CompileProvider) IsCompileError added in v1.1.8

func (prov *Py2CompileProvider) IsCompileError(remsg string) bool

type Py3CompileProvider

type Py3CompileProvider struct {
	CodeCompileProvider
}

func (*Py3CompileProvider) Compile

func (prov *Py3CompileProvider) Compile() (result bool, errmsg string)

func (*Py3CompileProvider) GetRunArgs

func (prov *Py3CompileProvider) GetRunArgs() (args []string)

func (*Py3CompileProvider) Init

func (prov *Py3CompileProvider) Init(code string, workDir string) error

func (*Py3CompileProvider) IsCompileError

func (prov *Py3CompileProvider) IsCompileError(remsg string) bool

type RubyCompileProvider

type RubyCompileProvider struct {
	CodeCompileProvider
}

func (*RubyCompileProvider) Compile

func (prov *RubyCompileProvider) Compile() (result bool, errmsg string)

func (*RubyCompileProvider) GetRunArgs

func (prov *RubyCompileProvider) GetRunArgs() (args []string)

func (*RubyCompileProvider) Init

func (prov *RubyCompileProvider) Init(code string, workDir string) error

func (*RubyCompileProvider) IsCompileError

func (prov *RubyCompileProvider) IsCompileError(remsg string) bool

Jump to

Keyboard shortcuts

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