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

62 lines
1.7 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$
//
//*******************************************************************
// lparser.cls: Sor elemz“. A PARSER-t“l ”r”k”l.
// 1999, Csisz r Levente
// Ez az elemz“ vonja ”ssze a folytat˘ sorokat.
// Mindig egy sort t rol a sorvgjellel egy<67>tt.
// A sorokon a k”vetkez“ transzform ci˘kat vgzi el (a sorrend
// fontos!).
//
// - '//', '&&' s a '*' kommenteket eldobja.
// - A '/*' kommentekben csak a cr-eket s az lf-eket hagyja meg,
// s a tokent <<3C>res>-re v ltoztatja.
// - Az egym s ut n k”vetkez“ <<3C>res>-eket ”sszevonja.
// - Megcsin lja a k”vetkez“ ”sszevon st.
// Az <Łjsor>-t a fil eleje is helyettesˇtheti.
//
// <Łjsor> <sor> ';' [<<3C>res>] <Łjsor> <<3C>res2> <ntoken> ==>
// <Łjsor> <Łjsor> <sor> ' ' <ntoken>
//
// <Łjsor> <sor> ';' [<<3C>res>] <Łjsor> <ntoken> ==>
// <Łjsor> <Łjsor> <sor> <ntoken>
//
// A <sor> b rmilyen token sorozat lehet, amiben nem szerepel
// ';' s <Łjsor>.
//
// A <ntoken> b rmilyen token lehet, kivve az <<3C>res> tokent.
//
// Ha egy sor <20>ress v lik, akkor az "" form ban kell kiˇrni.
// Ezt a hˇv˘nak kell kezelnie, itt nehzkes.
class LPARSER PARSER
rmethod readInput()
// Kiszri az egy soros megjegyzseket s  talakˇtja a
// '/*'-osakat
nmethod readLine()
// Bolvas egy teljes sort a parserBuffer-be. Az egy soros
// megjegyzseket eldobja, a t”bb sorosakat pedig feldolgozza
// Łgy, hogy azonos mennyisg Łj sort helyez el a parseBuffer
// elejre. A folytat˘ sorokat ”sszevonja.
rmethod readItem()
// Olvas egy elemet.
// Ret: Az elem, ha OK, nil, ha vge van a streamnek, vagy ha
// hiba volt.
// rmethod oinit(inputReader,name)
metaclass
// rmethod onew(inputReader,name)