summaryrefslogtreecommitdiff
path: root/chapter01/docs/01-grammar.ja.md
diff options
context:
space:
mode:
authorJun Kawasaki <jun784@gmail.com>2026-10-06 13:01:11 +0900
committerJun Kawasaki <jun784@gmail.com>2026-10-06 13:01:11 +0900
commit863a6ed0ad723e06c76f392d4fb3a5f6bd22863c (patch)
treecb0c42e19afbd06c455e977fa05980042da2e1d7 /chapter01/docs/01-grammar.ja.md
parent81b654d76444d747fdf1d053760e507b50f26e18 (diff)
downloadSimple-863a6ed0ad723e06c76f392d4fb3a5f6bd22863c.tar.gz
Simple-863a6ed0ad723e06c76f392d4fb3a5f6bd22863c.zip
docs: add Japanese translations for all chapters
Diffstat (limited to 'chapter01/docs/01-grammar.ja.md')
-rw-r--r--chapter01/docs/01-grammar.ja.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/chapter01/docs/01-grammar.ja.md b/chapter01/docs/01-grammar.ja.md
new file mode 100644
index 00000000..86e5ab71
--- /dev/null
+++ b/chapter01/docs/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]
+ ;
+```