From df40b24d8dbd8667a03416d043622ad6dec0768c Mon Sep 17 00:00:00 2001 From: Dibyendu Majumdar Date: Sat, 19 Aug 2023 08:52:57 -0700 Subject: Chapter 1: Introduction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cliff Click Co-authored-by: Thalia Archibald Co-authored-by: hadha Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Co-authored-by: Tamás Hadházy <85063808+Hels15@users.noreply.github.com> Co-authored-by: Jun Kawasaki --- docs/chapter01/01-grammar.ja.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/chapter01/01-grammar.ja.md (limited to 'docs/chapter01/01-grammar.ja.md') diff --git a/docs/chapter01/01-grammar.ja.md b/docs/chapter01/01-grammar.ja.md new file mode 100644 index 00000000..f0a91ee1 --- /dev/null +++ b/docs/chapter01/01-grammar.ja.md @@ -0,0 +1,32 @@ +# 第1章の文法 + +[English](01-grammar.md) | 日本語 + +この文書は [第1章の文法定義](01-grammar.md) の日本語版です。文法定義そのものは原文と同一です。 + +[第1章:導入に戻る](README.ja.md) + +```antlrv4 +grammar SimpleLanguage; + +program + : statement EOF + ; + +statement + : 'return' expression ';' + ; + +expression + : primaryExpression + ; + +primaryExpression + : INTEGER_LITERAL + ; + +INTEGER_LITERAL + : [1-9][0-9]* + | [0] + ; +``` -- cgit v1.2.3