Bläddra i källkod

update documentation

Vladislav Folts 10 år sedan
förälder
incheckning
12e91c5f11
3 ändrade filer med 31 tillägg och 1 borttagningar
  1. 1 1
      doc/wiki/eberon-methods.md
  2. 29 0
      doc/wiki/eberon-syntax-relaxations.md
  3. 1 0
      doc/wiki/eberon.md

+ 1 - 1
doc/wiki/eberon-methods.md

@@ -19,7 +19,7 @@ Example:
 
 
 Declared methods may be defined later using the same syntax as for ordinary procedures but having type name as a prefix to method name:
 Declared methods may be defined later using the same syntax as for ordinary procedures but having type name as a prefix to method name:
 
 
-    ProcedureDeclaration = ProcedureHeading ";" ProcedureBody ident ["." ident].
+    ProcedureDeclaration = ProcedureHeading ";" ProcedureBody [ident ["." ident]].
     ProcedureHeading = PROCEDURE [ident "."] identdef [FormalParameters].
     ProcedureHeading = PROCEDURE [ident "."] identdef [FormalParameters].
 
 
 Example:
 Example:

+ 29 - 0
doc/wiki/eberon-syntax-relaxations.md

@@ -0,0 +1,29 @@
+Here are additions to orginal oberon grammar to make it less strict in some cases.
+
+### Optional procedure identifier at the end
+Example:
+
+    PROCEDURE p; END; (* 'p' is note required before 'END' *)
+
+Pocedure name duplicating at the end is useless in case of small procedures. So it is optional in [[Eberon|eberon]].
+
+### Extra semicolon can be used in record last field declaration
+Example:
+
+    TYPE 
+        T = RECORD 
+            field1: INTEGER; 
+            field2: INTEGER; 
+            fieldn: INTEGER; (* semocolon is allowed here in Eberon, prohibited by original oberon grammar *)
+        END;
+
+Although this semicolon is "extra" from grammar standpoint it just inconvenient from editing/merge standpoint. So [[Eberon|eberon]] allows to have it.
+
+### Extra semicolon can be used after RETURN
+Example:
+    
+    PROCEDURE p(): INTEGER; 
+        RETURN 0; (* semocolon is allowed here in Eberon, prohibited by original oberon grammar *)
+    END;
+
+Although RETURN is not a statement from oberon grammar standpoint (it is a part of procedure declaration) it still looks and feels like a statement. So [[Eberon|eberon]] allows to have extra semicolon after it.

+ 1 - 0
doc/wiki/eberon.md

@@ -11,6 +11,7 @@ Eberon basically extends original Oberon (excluding additional [restrictions](#r
 * [[Array indexOf() method|eberon-array-methods]]
 * [[Array indexOf() method|eberon-array-methods]]
 * [[Record fields read-only export|eberon-record-fields-read-only-export]]
 * [[Record fields read-only export|eberon-record-fields-read-only-export]]
 * [[Procedure call result can be denoted|eberon-procedure-call-result]]
 * [[Procedure call result can be denoted|eberon-procedure-call-result]]
+* [[Syntax relaxations|eberon-syntax-relaxations]]
 * Non-scalar variables (arrays and records) can be exported (forbidden in oberon for some unknown reason).
 * Non-scalar variables (arrays and records) can be exported (forbidden in oberon for some unknown reason).
 
 
 ### Restrictions
 ### Restrictions