Files
harbour-core/harbour/samples/cccppc/lreader.och
1999-11-09 01:37:27 +00:00

357 lines
17 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// LREADER.och oszt ly implement ci¢.
// Gener lva: 1999.06.10, 14:40:06, OBJCCC v2.2.03
// Meta oszt ly defin¡ci¢: Van
#ifndef CA_CREADER_N
#ifdef _STRICT_PARENT_
#ifdef _CA_CM_ONLY_
#include "CREADER.och"
#else // _CA_CM_ONLY_
#define _CA_CM_ONLY_
#include "CREADER.och"
#undef _CA_CM_ONLY_
#endif // _CA_CM_ONLY_
#else
#include "CREADER.och"
#endif // _STRICT_PARENT_
#endif // CA_CREADER_N
#ifndef _CA_CM_ONLY_
#ifndef _LREADER_OCH_
#define _LREADER_OCH_
#xtranslate LREADER.<obj>:name => <obj>\[CA_OBJECT_N+1\]
#xtranslate LREADER.<obj>:errorstream => <obj>\[CA_OBJECT_N+2\]
#xtranslate LREADER.<obj>:tbuffer => <obj>\[CA_OBJECT_N+3\]
#xtranslate LREADER.<obj>:line => <obj>\[CA_READER_N+1\]
#xtranslate LREADER.<obj>:pos => <obj>\[CA_READER_N+2\]
#xtranslate LREADER.<obj>:oinit => (OBJGEN.(<obj>):(4))
#xtranslate LREADER.<obj>:getclass => (OBJGEN.(<obj>):(5))
#xtranslate LREADER.<obj>:isclass => (OBJGEN.(<obj>):(6))
#xtranslate LREADER.<obj>:getattrib => (OBJGEN.(<obj>):(7))
#xtranslate LREADER.<obj>:setattrib => (OBJGEN.(<obj>):(8))
#xtranslate LREADER.<obj>:read => (OBJGEN.(<obj>):(CM_OBJECT_N+1))
#xtranslate LREADER.<obj>:unread => (OBJGEN.(<obj>):(CM_OBJECT_N+2))
#xtranslate LREADER.<obj>:readtbuffer => (OBJGEN.(<obj>):(CM_OBJECT_N+3))
#xtranslate LREADER.<obj>:arraytbuffer => (OBJGEN.(<obj>):(CM_OBJECT_N+4))
#xtranslate LREADER.<obj>:readitem => (OBJGEN.(<obj>):(CM_OBJECT_N+5))
#xtranslate LREADER.<obj>:iserror => (OBJGEN.(<obj>):(CM_OBJECT_N+6))
#xtranslate LREADER.<obj>:adderror => (OBJGEN.(<obj>):(CM_OBJECT_N+7))
#xtranslate LREADER.<obj>:destruct => (OBJGEN.(<obj>):(CM_OBJECT_N+8))
#xtranslate LREADER.<obj>:getfile => (OBJGEN.(<obj>):(CM_READER_N+1))
#xtranslate LREADER.<obj>:getline => (OBJGEN.(<obj>):(CM_READER_N+2))
#xtranslate LREADER.<obj>:getpos => (OBJGEN.(<obj>):(CM_READER_N+3))
#xtranslate LREADER.<obj>:readerstack => <obj>\[CA_CREADER_N+1\]
#xtranslate LREADER.<obj>:bositem => <obj>\[CA_CREADER_N+2\]
#xtranslate LREADER.<obj>:eositem => <obj>\[CA_CREADER_N+3\]
// ™r”k”lve: readitem()
// Specifik lva: pushreader(aReader)
// Specifik lva: topreader()
// Specifik lva: popreader()
// Specifik lva: dropreader()
// Specifik lva: isempty()
// Specifik lva: getbositem()
// Specifik lva: geteositem()
// ™r”k”lve: getfile()
// ™r”k”lve: getline()
// ™r”k”lve: getpos()
// ™r”k”lve: oinit(BOSItem,EOSItem,name,errorStream)
// ™r”k”lve: readitem()
#xtranslate LREADER.<obj>:pushreader => (OBJGEN.(<obj>):(CM_CREADER_N+1))
#xtranslate LREADER.<obj>:topreader => (OBJGEN.(<obj>):(CM_CREADER_N+2))
#xtranslate LREADER.<obj>:popreader => (OBJGEN.(<obj>):(CM_CREADER_N+3))
#xtranslate LREADER.<obj>:dropreader => (OBJGEN.(<obj>):(CM_CREADER_N+4))
#xtranslate LREADER.<obj>:isempty => (OBJGEN.(<obj>):(CM_CREADER_N+5))
#xtranslate LREADER.<obj>:getbositem => (OBJGEN.(<obj>):(CM_CREADER_N+6))
#xtranslate LREADER.<obj>:geteositem => (OBJGEN.(<obj>):(CM_CREADER_N+7))
// ™r”k”lve: getfile()
// ™r”k”lve: getline()
// ™r”k”lve: getpos()
// ™r”k”lve: oinit(BOSItem,EOSItem,name,errorStream)
#endif // _LREADER_OCH_
#endif // _CA_CM_ONLY_
#ifndef CA_LREADER_N
#define CA_LREADER_N CA_CREADER_N+3
#define CM_LREADER_N CM_CREADER_N+7
#endif // CA_LREADER_N
#ifndef _CA_CM_ONLY_
#ifndef _LREADERCLASS_OCH_
#define _LREADERCLASS_OCH_
**********************************************************************
#xtranslate C.LREADER:<m> => (LREADERCLASS.clLREADER():<m>)
#xtranslate C.LREADER:self() => (clLREADER())
#xtranslate LREADERCLASS.<obj>:parent => <obj>\[CA_OBJECT_N+1\]
#xtranslate LREADERCLASS.<obj>:name => <obj>\[CA_OBJECT_N+2\]
#xtranslate LREADERCLASS.<obj>:objsize => <obj>\[CA_OBJECT_N+3\]
#xtranslate LREADERCLASS.<obj>:attribs => <obj>\[CA_OBJECT_N+4\]
#xtranslate LREADERCLASS.<obj>:methods => <obj>\[CA_OBJECT_N+5\]
#xtranslate LREADERCLASS.<obj>:classid => <obj>\[CA_OBJECT_N+6\]
#xtranslate LREADERCLASS.<obj>:parentclassids => <obj>\[CA_OBJECT_N+7\]
#xtranslate LREADERCLASS.<obj>:amblock => <obj>\[CA_OBJECT_N+8\]
#xtranslate LREADERCLASS.<obj>:methodsblock => <obj>\[CA_OBJECT_N+9\]
#xtranslate LREADERCLASS.<obj>:objmethodsimplement => <obj>\[CA_OBJECT_N+10\]
#xtranslate LREADERCLASS.<obj>:oinit => (OBJGEN.(<obj>):(4))
#xtranslate LREADERCLASS.<obj>:getclass => (OBJGEN.(<obj>):(5))
#xtranslate LREADERCLASS.<obj>:isclass => (OBJGEN.(<obj>):(6))
#xtranslate LREADERCLASS.<obj>:getattrib => (OBJGEN.(<obj>):(7))
#xtranslate LREADERCLASS.<obj>:setattrib => (OBJGEN.(<obj>):(8))
#xtranslate LREADERCLASS.<obj>:onew => (OBJGEN.(<obj>):(CM_OBJECT_N+1))
#xtranslate LREADERCLASS.<obj>:ocreate => (OBJGEN.(<obj>):(CM_OBJECT_N+2))
#xtranslate LREADERCLASS.<obj>:rawoinit => (OBJGEN.(<obj>):(CM_OBJECT_N+3))
#xtranslate LREADERCLASS.<obj>:oinitclass => (OBJGEN.(<obj>):(CM_OBJECT_N+4))
#xtranslate LREADERCLASS.<obj>:getmethodsimplement => (OBJGEN.(<obj>):(CM_OBJECT_N+5))
#xtranslate LREADERCLASS.<obj>:attribidx => (OBJGEN.(<obj>):(CM_OBJECT_N+6))
#xtranslate LREADERCLASS.<obj>:needclassid => (OBJGEN.(<obj>):(CM_OBJECT_N+7))
#xtranslate LREADERCLASS.<obj>:isinheritfrom => (OBJGEN.(<obj>):(CM_OBJECT_N+8))
// ™r”k”lve: onew(BOSItem,EOSItem,name,errorStream)
// ™r”k”lve: onew(BOSItem,EOSItem,name,errorStream)
#endif // _LREADERCLASS_OCH_
#endif // _CA_CM_ONLY_
#ifndef CA_LREADERCLASS_N
#define CA_LREADERCLASS_N CA_CREADERCLASS_N+0
#define CM_LREADERCLASS_N CM_CREADERCLASS_N+0
#endif // CA_LREADERCLASS_N
**********************************************************************
#ifdef _LREADER_PRG_
#ifndef _LREADER_PRG_OCH_
#define _LREADER_PRG_OCH_
**********************************************************************
#xtranslate othis:<m> => LREADER.(othis):<m>
#xtranslate thisclass:<m> => LREADERCLASS.(this:getClass()):<m>
#define CTHIS LREADER
**********************************************************************
#xtranslate this:<m> => LREADER.(this):<m>
#xcommand implement readitem() => static function readitem(this)
#xcommand implement pushreader(aReader) => ;
static function pushreader(this,aReader)
#xcommand implement topreader() => static function topreader(this)
#xcommand implement popreader() => static function popreader(this)
#xcommand implement dropreader() => static function dropreader(this)
#xcommand implement isempty() => static function isempty(this)
#xcommand implement getbositem() => static function getbositem(this)
#xcommand implement geteositem() => static function geteositem(this)
#xcommand implement getfile() => static function getfile(this)
#xcommand implement getline() => static function getline(this)
#xcommand implement getpos() => static function getpos(this)
#xcommand implement oinit(BOSItem,EOSItem,name,errorStream) => ;
static function oinit(this,BOSItem,EOSItem,name,errorStream)
#ifdef _IMPLEMENT_EXPORT_
#xcommand implement export readitem() => function readitem(this)
#xcommand implement export pushreader(aReader) => ;
function pushreader(this,aReader)
#xcommand implement export topreader() => function topreader(this)
#xcommand implement export popreader() => function popreader(this)
#xcommand implement export dropreader() => function dropreader(this)
#xcommand implement export isempty() => function isempty(this)
#xcommand implement export getbositem() => function getbositem(this)
#xcommand implement export geteositem() => function geteositem(this)
#xcommand implement export getfile() => function getfile(this)
#xcommand implement export getline() => function getline(this)
#xcommand implement export getpos() => function getpos(this)
#xcommand implement export oinit(BOSItem,EOSItem,name,errorStream) => ;
function oinit(this,BOSItem,EOSItem,name,errorStream)
#endif // _IMPLEMENT_EXPORT_
#xtranslate super:oinit => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(4))
#xtranslate super:getclass => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(5))
#xtranslate super:isclass => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(6))
#xtranslate super:getattrib => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(7))
#xtranslate super:setattrib => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(8))
#xtranslate super:read => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+1))
#xtranslate super:unread => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+2))
#xtranslate super:readtbuffer => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+3))
#xtranslate super:arraytbuffer => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+4))
#xtranslate super:readitem => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+5))
#xtranslate super:iserror => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+6))
#xtranslate super:adderror => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+7))
#xtranslate super:destruct => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_OBJECT_N+8))
#xtranslate super:getfile => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_READER_N+1))
#xtranslate super:getline => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_READER_N+2))
#xtranslate super:getpos => (OBJGENM.(eval(BEHAVIOR.clCREADER():objmethodsimplement)).(this):(CM_READER_N+3))
**********************************************************************
static function setCMethods(pOsztaly)
// Egy t”mb”t felt”lt az oszt ly mveleti blokkjaival.
pOsztaly[(CM_OBJECT_N+5)]:={|this| readitem(this)}
pOsztaly[(CM_CREADER_N+1)]:={|this,aReader| pushreader(this,aReader)}
pOsztaly[(CM_CREADER_N+2)]:={|this| topreader(this)}
pOsztaly[(CM_CREADER_N+3)]:={|this| popreader(this)}
pOsztaly[(CM_CREADER_N+4)]:={|this| dropreader(this)}
pOsztaly[(CM_CREADER_N+5)]:={|this| isempty(this)}
pOsztaly[(CM_CREADER_N+6)]:={|this| getbositem(this)}
pOsztaly[(CM_CREADER_N+7)]:={|this| geteositem(this)}
pOsztaly[(CM_READER_N+1)]:={|this| getfile(this)}
pOsztaly[(CM_READER_N+2)]:={|this| getline(this)}
pOsztaly[(CM_READER_N+3)]:={|this| getpos(this)}
pOsztaly[(4)]:={|this,BOSItem,EOSItem,name,errorStream| oinit(this,BOSItem,EOSItem,name,errorStream)}
return pOsztaly
**********************************************************************
static function setCams(ta,tm)
// Egy t”mb”t felt”lt az oszt ly  ltal def. objektumok attrib£tumaival s mveleteivel.
ta[CA_CREADER_N+1-CA_NIL_N] := {CA_CREADER_N+1,'readerstack', }
ta[CA_CREADER_N+2-CA_NIL_N] := {CA_CREADER_N+2,'bositem', }
ta[CA_CREADER_N+3-CA_NIL_N] := {CA_CREADER_N+3,'eositem', }
tm[(CM_OBJECT_N+5)-CM_NIL_N] := {(CM_OBJECT_N+5),'readitem','',nil}
tm[(CM_CREADER_N+1)-CM_NIL_N] := {(CM_CREADER_N+1),'pushreader','aReader',nil}
tm[(CM_CREADER_N+2)-CM_NIL_N] := {(CM_CREADER_N+2),'topreader','',nil}
tm[(CM_CREADER_N+3)-CM_NIL_N] := {(CM_CREADER_N+3),'popreader','',nil}
tm[(CM_CREADER_N+4)-CM_NIL_N] := {(CM_CREADER_N+4),'dropreader','',nil}
tm[(CM_CREADER_N+5)-CM_NIL_N] := {(CM_CREADER_N+5),'isempty','',nil}
tm[(CM_CREADER_N+6)-CM_NIL_N] := {(CM_CREADER_N+6),'getbositem','',nil}
tm[(CM_CREADER_N+7)-CM_NIL_N] := {(CM_CREADER_N+7),'geteositem','',nil}
tm[(CM_READER_N+1)-CM_NIL_N] := {(CM_READER_N+1),'getfile','',nil}
tm[(CM_READER_N+2)-CM_NIL_N] := {(CM_READER_N+2),'getline','',nil}
tm[(CM_READER_N+3)-CM_NIL_N] := {(CM_READER_N+3),'getpos','',nil}
tm[(4)-CM_NIL_N] := {(4),'oinit','BOSItem,EOSItem,name,errorStream',nil}
return nil
#ifndef _NO_CLLREADER_
#ifdef _STRICT_PARENT_
#ifdef _CA_CM_ONLY_
#include "meta.och"
#else // _CA_CM_ONLY_
#define _CA_CM_ONLY_
#include "meta.och"
#undef _CA_CM_ONLY_
#endif // _CA_CM_ONLY_
#else
#include "meta.och"
#endif // _STRICT_PARENT_
**********************************************************************
function clLREADER()
// El“szedi az oszt lyt. (class)
static osztaly
if (osztaly==nil)
osztaly:=META.mcLREADERCLASS():onew(;
clCREADER(),;
"LREADER",;
CA_LREADER_N,;
CM_LREADER_N,;
{|ta,tm|setCams(ta,tm)},;
{|t|setCMethods(t)})
endif
return osztaly
#endif // _NO_CLLREADER_
#ifndef _NO_LREADERCLASS_
**********************************************************************
#xtranslate class:<m> => LREADERCLASS.(class):<m>
#xcommand cimplement onew(BOSItem,EOSItem,name,errorStream) => ;
static function onew(class,BOSItem,EOSItem,name,errorStream)
#ifdef _IMPLEMENT_EXPORT_
#xcommand cimplement export onew(BOSItem,EOSItem,name,errorStream) => ;
function onew(class,BOSItem,EOSItem,name,errorStream)
#endif // _IMPLEMENT_EXPORT_
#xtranslate superclass:oinit => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(4))
#xtranslate superclass:getclass => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(5))
#xtranslate superclass:isclass => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(6))
#xtranslate superclass:getattrib => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(7))
#xtranslate superclass:setattrib => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(8))
#xtranslate superclass:onew => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+1))
#xtranslate superclass:ocreate => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+2))
#xtranslate superclass:rawoinit => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+3))
#xtranslate superclass:oinitclass => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+4))
#xtranslate superclass:getmethodsimplement => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+5))
#xtranslate superclass:attribidx => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+6))
#xtranslate superclass:needclassid => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+7))
#xtranslate superclass:isinheritfrom => (OBJGENM.(eval(BEHAVIOR.mcCREADERCLASS():objmethodsimplement)).(class):(CM_OBJECT_N+8))
**********************************************************************
static function setMCMethods(pOsztaly)
// Egy t”mb”t felt”lt a metaoszt ly mveleti blokkjaival.
pOsztaly[(CM_OBJECT_N+1)]:={|class,BOSItem,EOSItem,name,errorStream| onew(class,BOSItem,EOSItem,name,errorStream)}
return pOsztaly
**********************************************************************
static function setMCams(ta,tm)
// Egy t”mb”t felt”lt a metaoszt ly  ltal def. objektumok attrib£tumaival s mveleteivel.
tm[(CM_OBJECT_N+1)-CM_NIL_N] := {(CM_OBJECT_N+1),'onew','BOSItem,EOSItem,name,errorStream',nil}
return nil
**********************************************************************
#ifndef _NO_MCLREADERCLASS_
#ifdef _STRICT_PARENT_
#ifdef _CA_CM_ONLY_
#include "meta.och" // "metaclas.och"
#else // _CA_CM_ONLY_
#define _CA_CM_ONLY_
#include "meta.och" // "metaclas.och"
#undef _CA_CM_ONLY_
#endif // _CA_CM_ONLY_
#else
#include "meta.och" // "metaclas.och"
#endif // _STRICT_PARENT_
function mcLREADERCLASS()
// El“szedi az oszt ly metaoszt ly t. (metaclass)
static metaOsztaly
if (metaOsztaly==nil)
metaOsztaly:=META.clMETA():onew(;
mcCREADERCLASS(),;
"LREADERCLASS",;
CA_LREADERCLASS_N,;
CM_LREADERCLASS_N,;
{|ta,tm|setMCams(ta,tm)},;
{|t|setMCMethods(t)})
endif
return metaOsztaly
#endif // _NO_MCLREADERCLASS_
#endif // _NO_LREADERCLASS_
#ifdef _IMPLEMENT_ONEW_
**********************************************************************
cimplement onew(BOSItem,EOSItem,name,errorStream)
local o:=class:ocreate()
LREADER.o:oinit(BOSItem,EOSItem,name,errorStream)
return o
#endif // _IMPLEMENT_ONEW_
**********************************************************************
#ifdef _IMPLEMENT_OINIT_
implement oinit(BOSItem,EOSItem,name,errorStream)
super:oinit()
return this
#endif // _IMPLEMENT_OINIT_
**********************************************************************
**********************************************************************
#endif // _LREADER_PRG_OCH_
#endif // _LREADER_PRG_