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

114 lines
2.9 KiB
OpenEdge ABL
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.
//
// $Id$
//
//*******************************************************************
// nparser.cls: Nv elemz“. A PARSER-t“l ”r”k”l.
// 1999, Csisz r Levente
// Ez az elemz“ vgzi el az alapvet“ elemzseket, felbontja az input
// stream-et a k”vetkez“ tokenekre:
// - Nv
// - sz msor (nincs benne pont '.')
// - šres
// - Megjegyzs (csillag, perper, percsillag)
// - String (macskak”rm”s, idz“jeles)
// - —jsor
// - Karakter.
// Az egyb tokenek mindig pontosan egy karakteresek.
// A karaktereken kˇv<CB87>l megrti a k”vetkez“ egysgeket:
// CTK_BOS,CTK_EOS,CTK_PRINTLINE
// Az EOS-ra k<>ld egy Łj sor karatert
// Mj.: A ';' kezelst s a sor ”sszevon sokat az lparser elemz“
// csin lja.
class NPARSER PARSER
// attrib item
// attrib buf
attrib soreleje
attrib tokenPos // Egy Łj token olvas sakor a {file,line,pos}-t
// ide letessz<73>k. A makeToken ebb“l dolgozik.
rmethod readItem()
// Olvas egy elemet.
// Ret: Az elem, ha OK, nil, ha vge van a streamnek, vagy ha
// hiba volt.
nmethod strEolParserBuffer()
// Megadja a parserBuffer tartalm t stringknt.
// A nem stringeket az eol kivtelvel eldobja.
nmethod makeToken(tkId,str)
// Kszˇt egy tkId tˇpusŁ tokent 'str' tartalommal.
nmethod makeTokenSt(tkId,stArray)
// Kszˇt egy tkId tˇpusŁ tokenstr-t az stArray-nak megfelel“en.
nmethod makeTokenLSt(tkId,stArray)
// Kszˇt egy tkId tˇpusŁ tokenstr-t az stArray-nak megfelel“en.
// A str-be beˇrja a #line sort, ha a mlysg vagy a sorsz m
// nagyobb, mint 1.
nmethod makeErrToken(tkId,str,errCode)
// Kszˇt egy tkId tˇpusŁ tokent 'str' tartalommal s errCode
// hibak˘ddal.
nmethod parseTPTree()
nmethod parse()
// Ez vgzi a tnyleges elemzst, rekurzˇvan is lehet hˇvni.
// A this:item-t elemzi, sz<73>ksg esetn mg olvashat.
nmethod parseLineComment(tkId)
// '//' vagy '*' megjegyzs
nmethod parsePcComment()
// '/*'-os megjegyzs
nmethod parseString(hatarolo)
// Fels“vessz“s s macskak”rm”s string.
nmethod parseName()
// Nv.
nmethod parseNumberArray()
// Sz m sor. Ebben csak sz mok vannak, pont nem lehet.
rmethod oinit(inputReader,name,errorStream)
metaclass
rmethod onew(inputReader,name,errorStream)
attrib whitespacechar
// attrib specchar
attrib startnamechar
attrib numberchar
attrib namechar
attrib tokens
attrib tokenptree
rmethod oinitclass()
nmethod isWhitespacechar(c)
// nmethod isSpecchar(c)
nmethod isStartnamechar(c)
nmethod isNumberchar(c)
nmethod isNamechar(c)
nmethod setTokens()
// Felt”lti a class:tokens v ltoz˘t az oszt lyban defini lt
// tokenekkel.
nmethod calcTokenPTree()
// Kszˇt egy elemz“ f t a tokenek elemzshez a
// class:tokenPTree-be.