C# Class kompiler.FileWriter

Exibir arquivo Open project: jakl/hacks

Public Methods

Method Description
Add ( string code ) : void

Writes code to the current procedure

CloseFiles ( ) : void

Closes all files and sets the directory back up one level

DeclString ( string stringDecl ) : void

Writes a string declaration to the correct file

EndProcedure ( int memUse ) : void

Add the necessary "ProcName ENDP" and close the current procedure's file Perform basic efficieny guarentee by eliminating extraneous push/pop combos

FileWriter ( string projectName ) : System

Prepare the project's directory, with masm files, and strings/procedures include files. Change to that directory

Make ( ) : void

Run the windows command batch file to build and link the project

NewProcedure ( string procedureName ) : void

Creates a procedure; Will add the proper header to the new procedure : "functionName PROC" Sets the current working procedure to this one, to be written to by sequential Add() calls

ResetWorkingDirectory ( ) : void
WriteMainFile ( int mem ) : void

Write the top level program code to a file, that wraps and calls the main procedure

Private Methods

Method Description
WriteCommandFile ( string projectName ) : void

Method Details

Add() public method

Writes code to the current procedure
public Add ( string code ) : void
code string
return void

CloseFiles() public method

Closes all files and sets the directory back up one level
public CloseFiles ( ) : void
return void

DeclString() public method

Writes a string declaration to the correct file
public DeclString ( string stringDecl ) : void
stringDecl string
return void

EndProcedure() public method

Add the necessary "ProcName ENDP" and close the current procedure's file Perform basic efficieny guarentee by eliminating extraneous push/pop combos
public EndProcedure ( int memUse ) : void
memUse int
return void

FileWriter() public method

Prepare the project's directory, with masm files, and strings/procedures include files. Change to that directory
public FileWriter ( string projectName ) : System
projectName string
return System

Make() public method

Run the windows command batch file to build and link the project
public Make ( ) : void
return void

NewProcedure() public method

Creates a procedure; Will add the proper header to the new procedure : "functionName PROC" Sets the current working procedure to this one, to be written to by sequential Add() calls
public NewProcedure ( string procedureName ) : void
procedureName string
return void

ResetWorkingDirectory() public method

public ResetWorkingDirectory ( ) : void
return void

WriteMainFile() public method

Write the top level program code to a file, that wraps and calls the main procedure
public WriteMainFile ( int mem ) : void
mem int
return void