From 8da384b4669c8e3ddd54681f2adf7b975bf420a8 Mon Sep 17 00:00:00 2001 From: kisenka Date: Mon, 25 Aug 2014 23:00:19 +0400 Subject: [PATCH] Convert markup from Confuence wiki to Markdown --- grammar/src/attributes.grm | 2 +- grammar/src/class.grm | 10 ++++----- grammar/src/class_members.grm | 11 ++++----- grammar/src/control.grm | 4 ++-- grammar/src/enum.grm | 4 ++-- grammar/src/expressions.grm | 42 +++++++++++++++++------------------ grammar/src/lexical.grm | 14 +++++------- grammar/src/modifiers.grm | 2 +- grammar/src/notation.grm | 34 ++++++++++++++-------------- grammar/src/toplevel.grm | 8 +++---- grammar/src/types.grm | 7 +++--- grammar/src/when.grm | 4 ++-- 12 files changed, 66 insertions(+), 76 deletions(-) diff --git a/grammar/src/attributes.grm b/grammar/src/attributes.grm index 1bcf87c4341..d64b00690a3 100644 --- a/grammar/src/attributes.grm +++ b/grammar/src/attributes.grm @@ -1,5 +1,5 @@ /** -h2. Annotations +## Annotations */ annotations diff --git a/grammar/src/class.grm b/grammar/src/class.grm index 24b906edf93..7449b3a5710 100644 --- a/grammar/src/class.grm +++ b/grammar/src/class.grm @@ -1,11 +1,10 @@ /** -h2. Classes +## Classes -bq. See [Classes and Inheritance] +See [Classes and Inheritance](classes.html) */ /* - internal class Example>(protected val x : Foo, y : Some) : Bar(x), Foo by x, IAbstractSome by y.asAbstract() where @@ -13,7 +12,6 @@ internal class Example>(protected val x : Foo, y : So { // members } - */ class @@ -49,7 +47,7 @@ typeParameter ; /** -bq. See [Generic classes|Generics#Generic classes] +See [Generic classes](generics.html) */ typeConstraints @@ -61,5 +59,5 @@ typeConstraint : annotations "class" "object" SimpleName ":" type ; /** -bq. See [Generic constraints|Generics#Generic constraints] +See [Generic constraints](generics.html#generic-constraints) */ \ No newline at end of file diff --git a/grammar/src/class_members.grm b/grammar/src/class_members.grm index a894dae155f..17bbdcd1026 100644 --- a/grammar/src/class_members.grm +++ b/grammar/src/class_members.grm @@ -1,5 +1,5 @@ /** -h3. Class members +### Class members */ /* @@ -26,8 +26,6 @@ class Example(a : Foo, i : Int) : Bar(i), Some { } */ -// h5. Grammar - memberDeclaration : classObject : object @@ -46,7 +44,7 @@ classObject : modifiers "class" object ; /** -bq. See [Class objects|Classes and Inheritance#Class objects] +See [Class objects](classes.html#class-objects) */ valueParameters @@ -96,9 +94,8 @@ property ("by" | "=" expression SEMI?)? (getter? setter? | setter? getter?) SEMI? ; - /** -bq. See [Properties and Fields] +See [Properties and Fields](properties.html) */ getter @@ -118,5 +115,5 @@ parameter object : "object" SimpleName (":" delegationSpecifier{","})? classBody? // Class body can be optional: this is a declaration /** -bq. See [Object expressions and Declarations] +See [Object expressions and Declarations](object-declarations.html) */ diff --git a/grammar/src/control.grm b/grammar/src/control.grm index e1d285f885d..163f37c39c9 100644 --- a/grammar/src/control.grm +++ b/grammar/src/control.grm @@ -1,7 +1,7 @@ /** -h2. Control structures +## Control structures -bq. See [Control structures] +See [Control structures](control-flow.html) */ if diff --git a/grammar/src/enum.grm b/grammar/src/enum.grm index d8ff1a9366b..bfe40f51e99 100644 --- a/grammar/src/enum.grm +++ b/grammar/src/enum.grm @@ -1,7 +1,7 @@ /** -h3. Enum classes +### Enum classes -bq. See [Enum classes] +See [Enum classes](enum-classes.html) */ enumClassBody diff --git a/grammar/src/expressions.grm b/grammar/src/expressions.grm index 39e547baaf0..54e082b33a1 100644 --- a/grammar/src/expressions.grm +++ b/grammar/src/expressions.grm @@ -1,27 +1,28 @@ /** -h2. Expressions +## Expressions -bq. See [Expressions] + -h3. Precedence +### Precedence -||*Precedence*||Title||Symbols|| -|Highest|Postfix|{{\+\+}}, {{\-\-}}, {{.}}, {{?.}}, {{?}}| -| |Prefix|{{-}}, {{\+}}, {{\+\+}}, {{\-\-}}, {{!}}, [{{@label}}|#LabelName], {{@}}, {{@@}} | -| |Type RHS|{{:}}, {{as}}, {{as?}} | -| |Multiplicative|{{*}}, {{/}}, {{%}} | -| |Additive|{{\+}}, {{-}} | -| |Range|{{..}} | -| |Infix function|[{{SimpleName}}|#SimpleName] | -| |Elvis|{{?:}} | -| |Named checks|{{in}}, {{\!in}}, {{is}}, {{\!is}} | -| |Comparison|{{<}}, {{>}}, {{<=}}, {{>=}} | -| |Equality|{{==}}, {{\!==}}| -| |Conjunction|{{&&}}| -| |Disjunction|{{\|\|}}| -|Lowest|Assignment|{{=}}, {{+=}}, {{-=}}, {{*=}}, {{/=}}, {{%=}}| +| Precedence | Title | Symbols | +|------------|-------|---------| +| Highest | Postfix | `++`, `--`, `.`, `?.`, `?` | +| | Prefix | `-`, `+`, `++`, `--`, `!`, [`@label`](#LabelName), `@`, `@@` | +| | Type RHS | `:`, `as`, `as?` | +| | Multiplicative | `*`, `/`, `%` | +| | Additive | `+`, `-` | +| | Range | `..` | +| | Infix function | [`SimpleName`](#SimpleName) | +| | Elvis | `?:` | +| | Named checks | `in`, `!in`, `is`, `!is` | +| | Comparison | `<`, `>`, `<=`, `>=` | +| | Equality | `==`, `\!==` | +| | Conjunction | `&&` | +| | Disjunction | `||` | +| Lowest | Assignment | `=`, `+=`, `-=`, `*=`, `/=`, `%=` | -h3. Rules +### Rules */ @@ -43,7 +44,6 @@ Decreasing precedence: assignmentOperator */ - expression : disjunction (assignmentOperator disjunction)* ; @@ -284,5 +284,3 @@ objectLiteralMember factoryMethod : accessModifier? SimpleName typeParameters? functionParameters functionBody ; - -*/ diff --git a/grammar/src/lexical.grm b/grammar/src/lexical.grm index 1b8a53fc087..e30bbe626ad 100644 --- a/grammar/src/lexical.grm +++ b/grammar/src/lexical.grm @@ -1,5 +1,5 @@ /** -h1. Lexical structure +# Lexical structure */ [helper] @@ -23,7 +23,7 @@ CharacterLiteral : ; /** -bq. See [Basic types] +See [Basic types](basic-types.html) */ StringWithTemplates @@ -33,7 +33,7 @@ NoEscapeString : <"""-quoted string>; /** -bq. See [String templates|Strings#Templates] +See [String templates](basic-types.html#templates) */ SEMI @@ -46,21 +46,19 @@ SimpleName ; /** -bq. See [Java interoperability] +See [Java interoperability](java-interop.html) */ FieldName : "$" SimpleName; -/** -bq. See [Properties And Fields] -*/ +See [Properties And Fields](properties.html) LabelName : "@" SimpleName; /** -bq. See [Nonlocal returns and jumps] + */ /* Symbols: diff --git a/grammar/src/modifiers.grm b/grammar/src/modifiers.grm index 0944c0e2c9b..753c1e0c41a 100644 --- a/grammar/src/modifiers.grm +++ b/grammar/src/modifiers.grm @@ -1,5 +1,5 @@ /** -h2. Modifiers +## Modifiers */ modifiers diff --git a/grammar/src/notation.grm b/grammar/src/notation.grm index 964b7658740..31e43eef235 100644 --- a/grammar/src/notation.grm +++ b/grammar/src/notation.grm @@ -1,28 +1,28 @@ /** -h1. Notation +# Notation This section informally explains the grammar notation used below. -h2. Symbols and naming +## Symbols and naming -_Terminal symbol_ names start with an uppercase letter, e.g. *SimpleName* -_Nonterminal symbol_ names start with lowercase letter, e.g. *kotlinFile* -Each _production_ starts with a colon (*:*) -_Symbol definitions_ may have many productions and are terminated by a semicolon (*;*) -Symbol definitions may be prepended with _attributes_, e.g. {{start}} attribute denotes a start symbol +_Terminal symbol_ names start with an uppercase letter, e.g. **SimpleName**.
+_Nonterminal symbol_ names start with lowercase letter, e.g. **kotlinFile**.
+Each _production_ starts with a colon (**:**).
+_Symbol definitions_ may have many productions and are terminated by a semicolon (**;**).
+Symbol definitions may be prepended with _attributes_, e.g. `start` attribute denotes a start symbol. -h2. EBNF expressions +## EBNF expressions -Operator {color:blue}*|*{color} denotes _alternative_ -Operator {color:blue}*\**{color} denotes _iteration_ (zero or more) -Operator {color:blue}*+*{color} denotes _iteration_ (one or more) -Operator {color:blue}*?*{color} denotes _option_ (zero or one) -alpha{color:blue}*{*{color}beta{color:blue}*}*{color} denotes a nonempty _beta_-separated list of _alpha_'s +Operator `|` denotes _alternative_.
+Operator `*` denotes _iteration_ (zero or more).
+Operator `+` denotes _iteration_ (one or more).
+Operator `?` denotes _option_ (zero or one).
+alpha`{`beta`}` denotes a nonempty _beta_-separated list of _alpha_'s. -h1. Semicolons +# Semicolons -[Kotlin] provides "semicolon inference": syntactically, subsentences (e.g., statements, declarations etc) are separated by -the pseudo-token [SEMI|#SEMI], which stands for "semicolon or newline". In most cases, there's no need for semicolons in -[Kotlin] code. +Kotlin provides "semicolon inference": syntactically, subsentences (e.g., statements, declarations etc) are separated by +the pseudo-token [SEMI](#SEMI), which stands for "semicolon or newline". In most cases, there's no need for semicolons in +Kotlin code. */ diff --git a/grammar/src/toplevel.grm b/grammar/src/toplevel.grm index f9f244eb77b..c0c35ef12bc 100644 --- a/grammar/src/toplevel.grm +++ b/grammar/src/toplevel.grm @@ -1,7 +1,7 @@ /** -h1. Syntax +# Syntax -*Relevant pages:* [Namespaces] + */ @@ -28,7 +28,7 @@ import ; /** -bq. See [Imports|Namespaces#Imports] + */ toplevelObject @@ -48,7 +48,7 @@ package ; /** -bq. See [Namespaces] + */ [undocumented] diff --git a/grammar/src/types.grm b/grammar/src/types.grm index 49d15fd10f0..314601dbd78 100644 --- a/grammar/src/types.grm +++ b/grammar/src/types.grm @@ -1,7 +1,7 @@ /** -h2. Types +## Types -bq. See [Types] +See [Types](basic-types.html) */ /* @@ -14,6 +14,7 @@ Foo, T, Object> // user type type : annotations typeDescriptor + ; // IF YOU CHANGE THIS, please, update TYPE_FIRST in JetParsing typeDescriptor @@ -46,5 +47,3 @@ optionalProjection functionType : (type ".")? "(" (parameter | modifiers /*lazy out ref*/ type){","} ")" "->" type? ; - -//////////////////////////////////////// \ No newline at end of file diff --git a/grammar/src/when.grm b/grammar/src/when.grm index 309d6b62cd9..0b62990f311 100644 --- a/grammar/src/when.grm +++ b/grammar/src/when.grm @@ -1,7 +1,7 @@ /** -h4. Pattern matching +#### Pattern matching -bq. See [Pattern matching] + */ when