cvs: php-lang / c-like-syntax-spec.txt

[email protected] ("Sascha Schumann")
Newsgroups php.lang
Message-ID <cvssas974845109@cvsserver>
sas		Tue Nov 21 14:18:29 2000 EDT

  Modified files:
    /php-lang	c-like-syntax-spec.txt 
  Log:
  Add flow statements (die, exit)
  
  Add operators
  
  Clean up primary-/postfix-expressions
  
  Add casts
  
  
Index: php-lang/c-like-syntax-spec.txt
diff -u php-lang/c-like-syntax-spec.txt:1.4 php-lang/c-like-syntax-spec.txt:1.5
--- php-lang/c-like-syntax-spec.txt:1.4	Fri Nov 17 16:09:00 2000
+++ php-lang/c-like-syntax-spec.txt	Tue Nov 21 14:18:29 2000
@@ -1,4 +1,4 @@
-# $Id: c-like-syntax-spec.txt,v 1.4 2000/11/18 00:09:00 sas Exp $
+# $Id: c-like-syntax-spec.txt,v 1.5 2000/11/21 22:18:29 sas Exp $
 #
 # See Language_Notation.txt for notation notes
 
@@ -16,6 +16,7 @@
     jump-statement
     output-statement
     scope-statement
+    flow-statement
  
 labeled-statement:
     'case' constant ':' statement
@@ -75,6 +76,13 @@
     'static' variable-list ';'
     'unset' '(' variable-list ')' ';'
 
+flow-statement:
+    'exit' [exit-status] ';'
+    'die' [exit-status] ';'
+
+exit-status:
+    '(' [expression] ')'
+
 for-statement:
     statement
     colon-statement-list 'endfor' ';'
@@ -145,20 +153,122 @@
     string-constant
     interpolated-string
 
-postfix-expression:
+primary-expression:
     variable
+    constant
+    string-literal
+    '(' expression ')'
+
+postfix-expression:
     primary-expression
     postfix-expression '[' expression ']'
     postfix-expression '->' '{' expression '}'
     postfix-expression '->' identifier
-    identifier '(' [expression-list] ')'
     postfix-expression '.' expression
+    postfix-expression '++'
+    postfix-expression '--'
+    identifier '(' [expression-list] ')'
 
-primary-expression:
-    constant
-    string-literal
-    '(' expression ')'
+unary-expression:
+    postfix-expression
+    '++' unary-expression
+    '--' unary-expression
+    unary-operator cast-expression
+
+unary-operator: one of
+    '&' '*' '+' '-' '~' '!'
+
+cast-expression:
+    unary-expression
+    '(' type-name ')' expression
+
+# start of genoplist output
+
+multiplicative-expression:
+    cast-expression
+    multiplicative-expression '*' cast-expression
+    multiplicative-expression '/' cast-expression
+    multiplicative-expression '%' cast-expression
+
+concatenation-expression:
+    multiplicative-expression
+    concatenation-expression '.' multiplicative-expression
+
+additive-expression:
+    concatenation-expression
+    additive-expression '+' concatenation-expression
+    additive-expression '-' concatenation-expression
+
+shift-expression:
+    additive-expression
+    shift-expression '<<' additive-expression
+    shift-expression '>>' additive-expression
+
+relational-expression:
+    shift-expression
+    relational-expression '<' shift-expression
+    relational-expression '>' shift-expression
+    relational-expression '<=' shift-expression
+    relational-expression '>=' shift-expression
+
+identical-expression:
+    relational-expression
+    identical-expression '===' relational-expression
+    identical-expression '!==' relational-expression
+
+equality-expression:
+    identical-expression
+    equality-expression '==' identical-expression
+    equality-expression '!=' identical-expression
+
+and-expression:
+    equality-expression
+    and-expression '&' equality-expression
+
+exclusive-or-expression:
+    and-expression
+    exclusive-or-expression '^' and-expression
+
+inclusive-or-expression:
+    exclusive-or-expression
+    inclusive-or-expression '|' exclusive-or-expression
+
+boolean-and-expression:
+    inclusive-or-expression
+    boolean-and-expression '&&' inclusive-or-expression
+
+boolean-or-expression:
+    boolean-and-expression
+    boolean-or-expression '||' boolean-and-expression
+
+logical-and-expression:
+    boolean-or-expression
+    logical-and-expression 'AND' boolean-or-expression
+
+logical-exclusive-or-expression:
+    logical-and-expression
+    logical-exclusive-or-expression 'XOR' logical-and-expression
+
+logical-inclusive-or-expression:
+    logical-exclusive-or-expression
+    logical-inclusive-or-expression 'OR' logical-exclusive-or-expression
 
+	
+# end
+    
+type-name: one of
+    'string' 'unset' 'array' 'object'
+    boolean-type-name double-type-name integer-type-name
+
+boolean-type-name: one of
+    'bool' 'boolean'
+    
+double-type-name: one of
+    'real' 'double' 'float'
+
+integer-type-name: one of
+    'int' 'integer'
+    
 constant:
     integer-constant
     floating-constant
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.