# AsciiParser

アスキー書式の解釈を行うパーサーですが、`TWESYS::TimeOut`クラスをベースクラスに持つことで、タイムアウト処理を行っています。

## メソッド

### AsciiParser() - コンストラクタ

```cpp
AsciiParser(size_t maxbuffsiz)
AsciiParser(SmplBuf_Byte& bobj)
```

パーサーオブジェクトを生成します。

生成時のパラメータに`maxbuffsiz`を与えると、`maxbuffsiz`をバッファサイズとして動的にメモリ確保して、パーサーを初期化します。

あらかじめ生成された`SmplBuf_Byte`配列`bobj`を参照して、パーサーを初期化することもできます。

### \_u8Parse()

```cpp
uint8_t AsciiParser::_u8Parse(char_t u8byte)
```

アスキー書式の解釈アルゴリズムを実装します。バイトの入力のたびにタイムアウトのチェックを行います。

### \_vOutput()

```cpp
void AsciiParser::_vOutput(TWEUTILS::SmplBuf_Byte& bobj, TWE::IStreamOut& p)
```

書式出力を行います。`s_Output()`メソッドを呼び出します。

### s\_Output(), vPutByte()

```cpp
static void vPutByte(uint8_t u8byte, uint8_t* pu8lrc, TWE::IStreamOut& p)
static void s_vOutput(TWEUTILS::SmplBuf_Byte& bobj, TWE::IStreamOut& p)
```

`vPutByte()`は、ストリームに対して与えられたバイト`u8byte`をアスキー２文字で出力します。例えば0x9Aであれば"9A"という２バイト文字になります。

`s_vOutput()`は、ストリームに対して、与えられたバイト配列`SmplBuf_Byte`のバイト列をアスキー形式で出力します。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mwm5.twelite.info/0.8/references/parser/twesercmd/asciiparser.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
