0
こんにちは私は英語のc宣言をC言語の変数宣言に変換する文法を書こうとしています。 "xは "xはcharへのポインタへのポインタです"、 "xはタイプタイプstructの型構造体へのポインタです" < - > int * x [10]、 char ** x、 struct type-struct * x。BNF構文を使用してC言語変数の説明をC言語の変数宣言に翻訳する
私の試み: は、私はこの文法は再帰下降パーサを構築するために細かいかどうかを知りたい
description ::= id declaration type
declaration ::= declarator
declarator ::= pointer|function|array
pointer ::= pointer-to {pointer-to} function|array
array ::= array-of-n {pointer-to}
function ::= function-that-return {pointer-to}
type ::= int|char|short|float...|spec-struct
spec-struct ::= struct type-struct
「{0以上の項目があることを意味します}」。おかげさまで
質問がありますか? – Nate
単に 'cdecl'を呼んでいない理由がありますか?もしそうなら、あなたの特定の問題は何ですか? – Tim
この文法が再帰的降下構文解析プログラムを構築するのに問題ないかどうかを知りたいです。ありがとう – kabal