Recovered from cvs revision 2007-09-07 03:08:00

This commit is contained in:
hyung-hwan 2007-09-07 23:14:00 +00:00
parent 495d085cba
commit f212242f01
43 changed files with 836 additions and 92 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cpp,v 1.52 2007/08/26 14:33:38 bacon Exp $
* $Id: Awk.cpp,v 1.53 2007/09/06 08:44:42 bacon Exp $
*/
@ -57,6 +57,16 @@ namespace ASE
extio->handle = handle;
}
const Awk::extio_t* Awk::Extio::getRawExtio () const
{
return extio;
}
const Awk::run_t* Awk::Extio::getRawRun () const
{
return extio->run;
}
//////////////////////////////////////////////////////////////////
// Awk::Pipe
//////////////////////////////////////////////////////////////////
@ -690,14 +700,8 @@ namespace ASE
runarg[i].ptr = ase_awk_strxdup (awk, args[i], runarg[i].len);
if (runarg[i].ptr == ASE_NULL)
{
if (i > 0)
{
for (i-- ; i > 0; i--)
{
ase_awk_free (awk, runarg[i].ptr);
}
}
while (i > 0) ase_awk_free (awk, runarg[--i].ptr);
ase_awk_free (awk, runarg);
setError (ERR_NOMEM);
return -1;
}
@ -706,7 +710,7 @@ namespace ASE
runarg[i].ptr = ASE_NULL;
runarg[i].len = 0;
}
int n = ase_awk_run (
awk, main, &runios,
(runCallback? &runcbs: ASE_NULL),
@ -715,10 +719,7 @@ namespace ASE
if (runarg != ASE_NULL)
{
for (i--; i > 0; i--)
{
ase_awk_free (awk, runarg[i].ptr);
}
while (i > 0) ase_awk_free (awk, runarg[--i].ptr);
ase_awk_free (awk, runarg);
}

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.hpp,v 1.50 2007/09/04 08:01:46 bacon Exp $
* $Id: Awk.hpp,v 1.52 2007/09/06 14:38:56 bacon Exp $
*/
#ifndef _ASE_AWK_AWK_HPP_
@ -12,24 +12,62 @@
namespace ASE
{
/**
* the awk class
* Provides the awk interpreter engine
*/
class Awk
{
public:
/**
* boolean data type
*/
typedef ase_bool_t bool_t;
/**
* data type that can hold any character
*/
typedef ase_char_t char_t;
/**
* data type that can hold any character or
* an end-of-file value
*/
typedef ase_cint_t cint_t;
typedef ase_size_t size_t;
typedef ase_ssize_t ssize_t;
typedef ase_long_t long_t;
typedef ase_real_t real_t;
/**
* represents an internal awk value
*/
typedef ase_awk_val_t val_t;
/**
* represents the internal hash table
*/
typedef ase_awk_map_t map_t;
/**
* represents a key/value pair
*/
typedef ase_awk_pair_t pair_t;
/**
* represents the external i/o operation
*/
typedef ase_awk_extio_t extio_t;
/**
* represents the run-time instance of an awk interpreter
*/
typedef ase_awk_run_t run_t;
/**
* reprensts the underlying awk interpreter
*/
typedef ase_awk_t awk_t;
/**
@ -72,6 +110,17 @@ namespace ASE
const void* getHandle () const;
void setHandle (void* handle);
/**
* returns the underlying extio_t handle
*/
const extio_t* getRawExtio () const;
/**
* returns the underlying run_t handle associated
* with the underlying extio_t handle
*/
const run_t* getRawRun () const;
protected:
extio_t* extio;
};
@ -146,7 +195,7 @@ namespace ASE
};
/**
* Argument
* Represents an argument to an intrinsic function
*/
class Argument
{
@ -197,7 +246,7 @@ namespace ASE
};
/**
* Return
* represents a return value of an intrinsic function
*/
class Return
{
@ -233,7 +282,7 @@ namespace ASE
};
/**
* ErrorCode
* represens the error code
*/
// generated by generrcode.awk
@ -475,52 +524,93 @@ namespace ASE
virtual int run (const char_t* main = ASE_NULL,
const char_t** args = ASE_NULL, size_t nargs = 0);
/**
* defines the user-defined function
*/
typedef int (Awk::*FunctionHandler) (
Return* ret, const Argument* args, size_t nargs,
const char_t* name, size_t len);
/**
* adds a new user-defined function
*/
virtual int addFunction (
const char_t* name, size_t minArgs, size_t maxArgs,
FunctionHandler handler);
/**
* deletes a user-defined function
*/
virtual int deleteFunction (const char_t* main);
/**
* enables the run-time callback
*/
virtual void enableRunCallback ();
/**
* disables the run-time callback
*/
virtual void disableRunCallback ();
protected:
virtual int dispatchFunction (
run_t* run, const char_t* name, size_t len);
// source code io handlers
/**
* openSource
/**
* @name Source code I/O handlers
* A subclass should override the following methods to
* support the source code input and output.
* The awk interpreter calls the following methods when
* the parse method is invoked.
*/
/*@{*/
/** opens the source stream */
virtual int openSource (Source& io) = 0;
/** closes the source stream */
virtual int closeSource (Source& io) = 0;
/** reads from the source stream */
virtual ssize_t readSource (Source& io, char_t* buf, size_t len) = 0;
/** writes to the source stream */
virtual ssize_t writeSource (Source& io, char_t* buf, size_t len) = 0;
/*@}*/
// pipe io handlers
/**
* @name Pipe I/O handlers
* Pipe operations are achieved through the following methods.
*/
/*@{*/
virtual int openPipe (Pipe& io) = 0;
virtual int closePipe (Pipe& io) = 0;
virtual ssize_t readPipe (Pipe& io, char_t* buf, size_t len) = 0;
virtual ssize_t writePipe (Pipe& io, char_t* buf, size_t len) = 0;
virtual int flushPipe (Pipe& io) = 0;
/*@}*/
// file io handlers
/**
* @name File I/O handlers
* File operations are achieved through the following methods.
*/
/*@{*/
virtual int openFile (File& io) = 0;
virtual int closeFile (File& io) = 0;
virtual ssize_t readFile (File& io, char_t* buf, size_t len) = 0;
virtual ssize_t writeFile (File& io, char_t* buf, size_t len) = 0;
virtual int flushFile (File& io) = 0;
/*@}*/
// console io handlers
/**
* @name Console I/O handlers
* Console operations are achieved through the following methods.
*/
virtual int openConsole (Console& io) = 0;
virtual int closeConsole (Console& io) = 0;
virtual ssize_t readConsole (Console& io, char_t* buf, size_t len) = 0;
virtual ssize_t writeConsole (Console& io, char_t* buf, size_t len) = 0;
virtual int flushConsole (Console& io) = 0;
virtual int nextConsole (Console& io) = 0;
/*@}*/
// run-time callbacks
virtual void onRunStart (const Run& run);

View File

@ -1,5 +1,5 @@
/*
* $Id: StdAwk.cpp,v 1.24 2007/08/26 14:33:38 bacon Exp $
* $Id: StdAwk.cpp,v 1.25 2007/09/06 09:23:34 bacon Exp $
*/
#include <ase/awk/StdAwk.hpp>
@ -129,6 +129,13 @@ namespace ASE
return ret->set ((long_t)prevSeed);
}
#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER>=1400)
#define time_t __time64_t
#define time _time64
#define localtime _localtime64
#define gmtime _gmtime64
#endif
int StdAwk::systime (Return* ret, const Argument* args, size_t nargs,
const char_t* name, size_t len)
{

View File

@ -1,4 +1,4 @@
[0.2.1]
[0.3.0]
* added ase_awk_setword to enable customization of keywords and
intrinsic function names.

View File

@ -10,9 +10,9 @@ ASE is a programming library implementing various programming languages and text
Download the library source code from the following links.
ase-0.2.0.tgz
ase-0.3.0.tgz
[[[
* {Link 1,ase-0.2.0.tgz}
* {Link 1,ase-0.3.0.tgz}
]]]
== Documentation ==

View File

@ -10,9 +10,9 @@ ASE는 임베딩을 목적으로 여러가지 프로그래밍언어를 구현하
다음 링크에서 소스코드를 받을수 있다.
ase-0.2.0.tgz
ase-0.3.0.tgz
[[[
* {링크 1,ase-0.2.0.tgz}
* {링크 1,ase-0.3.0.tgz}
* 링크 2
]]]

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cpp,v 1.22 2007/08/24 13:17:59 bacon Exp $
* $Id: Awk.cpp,v 1.23 2007/09/06 08:44:42 bacon Exp $
*/
#include "stdafx.h"
@ -87,7 +87,15 @@ namespace ASE
const char_t* getErrorString (ASE::Net::Awk^ wrapper, ErrorCode num) const
{
this->wrapper = wrapper;
const char_t* x = Awk::getErrorString(num);
const char_t* x = Awk::getErrorString (num);
this->wrapper = nullptr;
return x;
}
int setErrorString (ASE::Net::Awk^ wrapper, ErrorCode num, const char_t* msg)
{
this->wrapper = wrapper;
int x = Awk::setErrorString (num, msg);
this->wrapper = nullptr;
return x;
}
@ -165,6 +173,7 @@ namespace ASE
void onRunStart (const Run& run)
{
wrapper->runErrorReported = false;
wrapper->stopRequested = false;
if (wrapper->OnRunStart != nullptr)
{
@ -197,6 +206,8 @@ namespace ASE
void onRunStatement (const Run& run, size_t line)
{
if (wrapper->stopRequested) run.stop ();
if (wrapper->OnRunStatement != nullptr)
{
wrapper->OnRunStatement (wrapper);
@ -650,6 +661,20 @@ namespace ASE
if (awk != NULL) awk->setOption (this, (int)this->option);
}
bool Awk::SetErrorString (Awk::ERROR num, System::String^ msg)
{
if (awk == NULL)
{
setError (ERROR::NOPER);
return false;
}
cli::pin_ptr<const ASE::Awk::char_t> nptr = PtrToStringChars(msg);
bool r = (awk->setErrorString (this, (ASE::Awk::ErrorCode)num, nptr) == 0);
if (!r) { retrieveError (); }
return r;
}
void Awk::Close ()
{
if (awk != NULL)
@ -687,6 +712,7 @@ namespace ASE
bool Awk::Run (System::String^ entryPoint, cli::array<System::String^>^ args)
{
runErrorReported = false;
stopRequested = false;
if (awk == NULL)
{
@ -694,11 +720,12 @@ namespace ASE
return false;
}
if (OnRunStart != nullptr || OnRunEnd != nullptr ||
OnRunReturn != nullptr || OnRunStatement != nullptr)
{
// callback needs to be enabled to support the Stop method
//if (OnRunStart != nullptr || OnRunEnd != nullptr ||
// OnRunReturn != nullptr || OnRunStatement != nullptr)
//{
awk->enableRunCallback (this);
}
//}
if (args == nullptr || args->Length <= 0)
{
@ -801,6 +828,11 @@ namespace ASE
}
}
void Awk::Stop ()
{
stopRequested = true;
}
bool Awk::AddFunction (
System::String^ name, int minArgs, int maxArgs,
FunctionHandler^ handler)

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.hpp,v 1.20 2007/08/26 14:33:38 bacon Exp $
* $Id: Awk.hpp,v 1.21 2007/09/06 08:44:42 bacon Exp $
*/
#pragma once
@ -470,6 +470,11 @@ namespace ASE
virtual bool Run ();
virtual bool Run (System::String^ entryPoint, cli::array<System::String^>^ args);
/**
* sets the request to stop the Run method
*/
virtual void Stop ();
delegate void RunStartHandler (Awk^ awk);
delegate void RunEndHandler (Awk^ awk);
delegate void RunReturnHandler (Awk^ awk);
@ -491,10 +496,12 @@ namespace ASE
virtual bool SetMaxDepth (DEPTH id, size_t depth);
virtual bool GetMaxDepth (DEPTH id, size_t* depth);
virtual bool SetErrorString (ERROR num, System::String^ str);
property OPTION Option
{
OPTION get (); //{ return this->option; }
void set (OPTION opt); //{ this->option = opt; }
OPTION get ();
void set (OPTION opt);
}
property System::String^ ErrorMessage
@ -567,6 +574,7 @@ namespace ASE
void setError (ERROR num);
void retrieveError ();
bool runErrorReported; // only used if the run-callback is activated.
bool stopRequested;
};
}

View File

@ -1,5 +1,5 @@
/*
* $Id: StdAwk.cpp,v 1.10 2007/09/05 14:42:06 bacon Exp $
* $Id: StdAwk.cpp,v 1.12 2007/09/06 09:23:34 bacon Exp $
*/
#include "stdafx.h"
@ -112,6 +112,13 @@ namespace ASE
return true;
}
#if defined(_WIN32) && defined(_MSC_VER) && (_MSC_VER>=1400)
#define time_t __time64_t
#define time _time64
#define localtime _localtime64
#define gmtime _gmtime64
#endif
bool StdAwk::Systime (System::String^ name, array<Argument^>^ args, Return^ ret)
{
ret->LongValue = (long_t)::time(NULL);
@ -221,15 +228,8 @@ namespace ASE
}
else
{
try{
System::IO::StreamWriter^ sw = (System::IO::StreamWriter^)file->Handle;
sw->Close ();
}
catch (...)
{
System::Diagnostics::Debug::Print ("XXXXXX");
}
}
return 0;
}

View File

@ -1,5 +1,5 @@
/*
* $Id: doc.awk,v 1.3 2007/04/30 08:32:40 bacon Exp $
* $Id: doc.awk,v 1.4 2007/09/06 09:05:32 bacon Exp $
*
* {License}
*/
@ -56,7 +56,7 @@ BEGIN {
empty_line_count = 0;
para_started = 0;
#output=ARGV[0];
#output=ARGV[1];
#gsub (/\.man/, ".html", output);
#print "OUTPUT TO: " output;

View File

@ -1,11 +1,11 @@
/*
* $Id: lic.awk,v 1.3 2007/04/30 08:32:40 bacon Exp $
* $Id: lic.awk,v 1.4 2007/09/06 09:05:32 bacon Exp $
*
* {License}
*/
NR == 1 {
new_file = ARGV[0];
new_file = ARGV[1];
printf "" > new_file; /* clear the file */
}

View File

@ -0,0 +1,102 @@
# Microsoft Developer Studio Project File - Name="asetestawk++" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=asetestawk++ - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "asetestawk++.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "asetestawk++.mak" CFG="asetestawk++ - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "asetestawk++ - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "asetestawk++ - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "asetestawk++ - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../release/bin"
# PROP Intermediate_Dir "release/cpp"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 asecmn.lib aseawk.lib aseawk++.lib aseutl.lib user32.lib kernel32.lib /nologo /subsystem:console /machine:I386 /out:"../../release/bin/aseawk++.exe" /libpath:"../../release/lib"
!ELSEIF "$(CFG)" == "asetestawk++ - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../debug/bin"
# PROP Intermediate_Dir "debug/cpp"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 asecmn.lib aseawk.lib aseawk++.lib aseutl.lib user32.lib kernel32.lib /nologo /subsystem:console /debug /machine:I386 /out:"../../debug/bin/aseawk++.exe" /pdbtype:sept /libpath:"../../debug/lib"
!ENDIF
# Begin Target
# Name "asetestawk++ - Win32 Release"
# Name "asetestawk++ - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\Awk.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project

View File

@ -36,7 +36,7 @@ BEGIN {
for (pc = 0; pc >= 0; ) {
addr = mem[pc] % 1000;
code = int(mem[pc++] / 1000);
if (code == op["get"]) { getline acc; }
if (code == op["get"]) { if (getline acc <= 0) acc = 0; }
else if (code == op["put"]) { print acc; }
else if (code == op["st"]) { mem[addr] = acc; }
else if (code == op["ld"]) { acc = mem[addr]; }

View File

@ -5,4 +5,4 @@ BEGIN {
abc = 10;
}
RUN ERROR: CODE [94] LINE [5] map 'abc' not assignable with a scalar
RUN ERROR: CODE [95] LINE [5] map 'abc' not assignable with a scalar

View File

@ -2,4 +2,4 @@ BEGIN {
delete ARGC;
}
RUN ERROR: CODE [86] LINE [2] variable 'ARGC' not deletable
RUN ERROR: CODE [87] LINE [2] variable 'ARGC' not deletable

View File

@ -3,4 +3,4 @@ BEGIN {
delete iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiix;
}
RUN ERROR: CODE [86] LINE [3] variable 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...' not deletable
RUN ERROR: CODE [87] LINE [3] variable 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii...' not deletable

View File

@ -2,4 +2,4 @@ BEGIN {
helpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhelphelp ();
}
RUN ERROR: CODE [84] LINE [2] function 'helpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhel...' not found
RUN ERROR: CODE [85] LINE [2] function 'helpxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhel...' not found

View File

@ -1 +1 @@
PARSE ERROR: CODE [55] LINE [2] built-in function 'substr' redefined
PARSE ERROR: CODE [56] LINE [2] built-in function 'substr' redefined

View File

@ -1 +1 @@
PARSE ERROR: CODE [55] LINE [3] built-in function 'substr' redefined
PARSE ERROR: CODE [56] LINE [3] built-in function 'substr' redefined

View File

@ -1 +1 @@
PARSE ERROR: CODE [56] LINE [9] function 'abc' redefined
PARSE ERROR: CODE [57] LINE [9] function 'abc' redefined

View File

@ -1 +1 @@
PARSE ERROR: CODE [57] LINE [4] global variable 'abc' redefined
PARSE ERROR: CODE [58] LINE [4] global variable 'abc' redefined

View File

@ -1 +1 @@
PARSE ERROR: CODE [58] LINE [4] parameter 'x' redefined
PARSE ERROR: CODE [59] LINE [4] parameter 'x' redefined

View File

@ -1 +1 @@
PARSE ERROR: CODE [56] LINE [11] function 'abc' redefined
PARSE ERROR: CODE [57] LINE [11] function 'abc' redefined

View File

@ -1 +1 @@
PARSE ERROR: CODE [56] LINE [1] function 'abc' redefined
PARSE ERROR: CODE [57] LINE [1] function 'abc' redefined

View File

@ -1 +1 @@
PARSE ERROR: CODE [42] LINE [5] a colon expected in place of ';'
PARSE ERROR: CODE [43] LINE [5] a colon expected in place of ';'

View File

@ -1 +1 @@
PARSE ERROR: CODE [37] LINE [2] a left parenthesis expected in place of '='
PARSE ERROR: CODE [38] LINE [2] a left parenthesis expected in place of '='

View File

@ -1 +1 @@
PARSE ERROR: CODE [51] LINE [2] BEGIN not followed by a left bracket on the same line
PARSE ERROR: CODE [52] LINE [2] BEGIN not followed by a left bracket on the same line

View File

@ -1 +1 @@
PARSE ERROR: CODE [62] LINE [1] '+' not a valid parameter name
PARSE ERROR: CODE [63] LINE [1] '+' not a valid parameter name

View File

@ -1 +1 @@
PARSE ERROR: CODE [63] LINE [1] '+' not a valid variable name
PARSE ERROR: CODE [64] LINE [1] '+' not a valid variable name

View File

@ -1 +1 @@
PARSE ERROR: CODE [63] LINE [3] '+' not a valid variable name
PARSE ERROR: CODE [64] LINE [3] '+' not a valid variable name

View File

@ -2,4 +2,4 @@ BEGIN {
print abc > "123\0abc";
}
RUN ERROR: CODE [109] LINE [2] i/o name containing a null character
RUN ERROR: CODE [110] LINE [2] i/o name containing a null character

View File

@ -3,4 +3,4 @@ BEGIN {
split ("a b c",xx);
}
RUN ERROR: CODE [95] LINE [3] cannot change a scalar value to a map
RUN ERROR: CODE [96] LINE [3] cannot change a scalar value to a map

View File

@ -1,5 +1,5 @@
/*
* $Id: Awk.cs,v 1.1 2007/09/03 03:50:39 bacon Exp $
* $Id: Awk.cs,v 1.2 2007/09/06 09:37:42 bacon Exp $
*/
using System;
@ -142,10 +142,10 @@ namespace ase.com
set { awk.SupportBlockless = value; }
}
public bool StringBaseOne
public bool BaseOne
{
get { return awk.StringBaseOne; }
set { awk.StringBaseOne = value; }
get { return awk.BaseOne; }
set { awk.BaseOne = value; }
}
public bool StripSpaces

123
ase/test/com/AwkForm.resx Normal file
View File

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,33 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ase.com")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ase.com")]
[assembly: AssemblyCopyright("© 2007 Hyung-Hwan Chung, All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7cd62543-7cf6-4b69-90b9-be0becdbfa19")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ase.com.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ase.com.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ase.test.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -0,0 +1,86 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{F14B75D8-3ED7-4621-B5B9-E96A80B5D809}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ase.com</RootNamespace>
<AssemblyName>ase.com</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Debug\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Release\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Interop.ASECOM, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\cnt\obj\Debug\Interop.ASECOM.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Awk.cs" />
<Compile Include="AwkForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="AwkForm.Designer.cs">
<DependentUpon>AwkForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="AwkForm.resx">
<SubType>Designer</SubType>
<DependentUpon>AwkForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="StdAwk.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -12,6 +12,17 @@ namespace ase.net
System.Windows.Forms.TextBox consoleInput;
System.Windows.Forms.TextBox consoleOutput;
System.ComponentModel.ISynchronizeInvoke si;
public Awk(System.ComponentModel.ISynchronizeInvoke si)
{
this.si = si;
SetSourceOutputHandlers += SetSourceOutput;
SetConsoleOutputHandlers += SetConsoleOutput;
AddFunction("sleep", 1, 1, Sleep);
}
public bool Parse(
System.Windows.Forms.TextBox sourceInput,
System.Windows.Forms.TextBox sourceOutput)
@ -31,6 +42,13 @@ namespace ase.net
return base.Run(main, args);
}
protected bool Sleep(string name, Argument[] args, Return ret)
{
System.Threading.Thread.Sleep((int)(args[0].LongValue*1000));
ret.LongValue = 0;
return true;
}
protected override int OpenSource(ASE.Net.StdAwk.Source source)
{
//System.IO.FileMode mode;
@ -63,6 +81,22 @@ namespace ase.net
return -1;
}
public delegate void SetSourceOutputHandler(string text);
public delegate void SetConsoleOutputHandler(string text);
public event SetSourceOutputHandler SetSourceOutputHandlers;
public event SetConsoleOutputHandler SetConsoleOutputHandlers;
private void SetSourceOutput(string text)
{
sourceOutput.Text = text;
}
private void SetConsoleOutput(string text)
{
consoleOutput.Text = text;
}
protected override int CloseSource(ASE.Net.StdAwk.Source source)
{
if (source.Mode.Equals(ASE.Net.StdAwk.Source.MODE.READ))
@ -75,9 +109,16 @@ namespace ase.net
{
System.IO.StreamWriter sw = (System.IO.StreamWriter)source.Handle;
sw.Flush();
System.IO.MemoryStream ms = (System.IO.MemoryStream)sw.BaseStream;
sourceOutput.Text = UnicodeEncoding.UTF8.GetString(ms.GetBuffer());
sw.Close();
// MSDN: This method(GetBuffer) works when the memory stream is closed.
//sourceOutput.Text = UnicodeEncoding.UTF8.GetString(ms.GetBuffer());
if (si != null && si.InvokeRequired)
si.Invoke(SetSourceOutputHandlers, new object[] { UnicodeEncoding.UTF8.GetString(ms.GetBuffer()) });
else SetSourceOutput (UnicodeEncoding.UTF8.GetString(ms.GetBuffer()));
return 0;
}
@ -130,9 +171,16 @@ namespace ase.net
{
System.IO.StreamWriter sw = (System.IO.StreamWriter)console.Handle;
sw.Flush();
System.IO.MemoryStream ms = (System.IO.MemoryStream)sw.BaseStream;
consoleOutput.Text = UnicodeEncoding.UTF8.GetString(ms.GetBuffer());
sw.Close();
// MSDN: This method(GetBuffer) works when the memory stream is closed.
//consoleOutput.Text = UnicodeEncoding.UTF8.GetString(ms.GetBuffer());
if (si != null && si.InvokeRequired)
si.Invoke(SetConsoleOutputHandlers, new object[] { UnicodeEncoding.UTF8.GetString(ms.GetBuffer()) });
else SetConsoleOutput(UnicodeEncoding.UTF8.GetString(ms.GetBuffer()));
return 0;
}
@ -141,7 +189,7 @@ namespace ase.net
protected override int ReadConsole(ASE.Net.StdAwk.Console console, char[] buf, int len)
{
System.IO.StreamReader sr = (System.IO.StreamReader)console.Handle;
System.IO.StreamReader sr = (System.IO.StreamReader)console.Handle;
return sr.Read(buf, 0, len);
}
@ -149,6 +197,7 @@ namespace ase.net
{
System.IO.StreamWriter sw = (System.IO.StreamWriter)console.Handle;
sw.Write(buf, 0, len);
sw.Flush();
return len;
}

View File

@ -47,12 +47,12 @@ namespace ase.net
this.panel2 = new System.Windows.Forms.Panel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.chkStripSpaces = new System.Windows.Forms.CheckBox();
this.chkPassArgumentsToEntryPoint = new System.Windows.Forms.CheckBox();
this.btnClearAllArguments = new System.Windows.Forms.Button();
this.btnAddArgument = new System.Windows.Forms.Button();
this.tbxArgument = new System.Windows.Forms.TextBox();
this.lbxArguments = new System.Windows.Forms.ListBox();
this.chkStripSpaces = new System.Windows.Forms.CheckBox();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.panel3.SuspendLayout();
@ -281,6 +281,18 @@ namespace ase.net
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Arguments";
//
// chkStripSpaces
//
this.chkStripSpaces.AutoSize = true;
this.chkStripSpaces.Checked = true;
this.chkStripSpaces.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkStripSpaces.Location = new System.Drawing.Point(19, 234);
this.chkStripSpaces.Name = "chkStripSpaces";
this.chkStripSpaces.Size = new System.Drawing.Size(86, 17);
this.chkStripSpaces.TabIndex = 5;
this.chkStripSpaces.Text = "Strip Spaces";
this.chkStripSpaces.UseVisualStyleBackColor = true;
//
// chkPassArgumentsToEntryPoint
//
this.chkPassArgumentsToEntryPoint.AutoSize = true;
@ -328,18 +340,6 @@ namespace ase.net
this.lbxArguments.Size = new System.Drawing.Size(147, 134);
this.lbxArguments.TabIndex = 0;
//
// chkStripSpaces
//
this.chkStripSpaces.AutoSize = true;
this.chkStripSpaces.Checked = true;
this.chkStripSpaces.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkStripSpaces.Location = new System.Drawing.Point(19, 234);
this.chkStripSpaces.Name = "chkStripSpaces";
this.chkStripSpaces.Size = new System.Drawing.Size(86, 17);
this.chkStripSpaces.TabIndex = 5;
this.chkStripSpaces.Text = "Strip Spaces";
this.chkStripSpaces.UseVisualStyleBackColor = true;
//
// AwkForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

Binary file not shown.