> For the complete documentation index, see [llms.txt](https://mwm5.twelite.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mwm5.twelite.info/0.9-1/references/parser/twesercmd/asciiparser.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://mwm5.twelite.info/0.9-1/references/parser/twesercmd/asciiparser.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
