eos

xpeg::eos : Element(Element::TYPE_EOS);

Description

End of Stream の略です。Streamの終端で1回だけmatchします。

Bug

単体で使うとStream終端で複数回matchします。scanとかで使うと無限ループします。

Example

テキストファイルを1行ずつイテレートするサンプルです。最終行に改行が無くても表示します。

C++

Xtal

if (fs : FileStream("text.txt", "r")){
    fs.scan(xpeg::eol|xpeg::eos){
        it.prefix.p;
    }
}
else {
    "cannot open file".p;
}

Output

text file
no
中身
desu
reference/xpeg/eos.txt · 最終更新: 2011/07/14 23:05 by sukai
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0