C# Class WF.Compiler.LUA

This static libray contains all function for handling the Lua source code.
Datei anzeigen Open project: WFoundation/WF.Compiler Class Usage Examples

Public Methods

Method Description
Check ( Stream stream, string luaFileName ) : void

Check the specified luaCode in stream to see, if there are any errors.

Check ( string luaCode, string luaFileName ) : void

Check the specified luaCode to see, if there are any errors.

Compile ( string luaCode, string fileName = "Cartridge" ) : byte[]
Extract ( Stream stream ) : Cartridge

Extract cartridge data from specified luaCode in given stream.

Extract ( string luaCode ) : Cartridge

Extract cartridge data from the given specified luaCode in given string.

Private Methods

Method Description
ConvertToPlain ( string luaCode ) : string

Converts the original Lua code to a plain version.

Replace all -
\n with \n -
with \n - long strings with only a \n with short strings containing \n This works although for Urwigo and Earwigo encoded strings. They are decoded, changed and encoded again.

ExtractDirectives ( LuaTable directives ) : List

Extracts the directives for a given media resource.

ExtractMedia ( LuaTable obj ) : Media

Extracts the media from the Lua code.

ExtractMediaResources ( LuaTable resources ) : List

Extracts the media resources from Lua.

Method Details

Check() public static method

Check the specified luaCode in stream to see, if there are any errors.
public static Check ( Stream stream, string luaFileName ) : void
stream Stream
luaFileName string
return void

Check() public static method

Check the specified luaCode to see, if there are any errors.
public static Check ( string luaCode, string luaFileName ) : void
luaCode string String with Lua code to check.
luaFileName string
return void

Compile() public static method

public static Compile ( string luaCode, string fileName = "Cartridge" ) : byte[]
luaCode string
fileName string
return byte[]

Extract() public static method

Extract cartridge data from specified luaCode in given stream.
public static Extract ( Stream stream ) : Cartridge
stream Stream
return Cartridge

Extract() public static method

Extract cartridge data from the given specified luaCode in given string.
public static Extract ( string luaCode ) : Cartridge
luaCode string String with Lua code.
return Cartridge