summaryrefslogtreecommitdiffstats
path: root/libtommath/tombc
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-04-10 23:54:55 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-04-10 23:54:55 (GMT)
commit9c989aeec930a9251ba5eddc6a81898a5c91ee0e (patch)
tree8809a65920a763a8894572aee81a71eeff4b2c82 /libtommath/tombc
parent2168824a1ddf134001dd68311befeb7d58dddd38 (diff)
downloadtcl-9c989aeec930a9251ba5eddc6a81898a5c91ee0e.zip
tcl-9c989aeec930a9251ba5eddc6a81898a5c91ee0e.tar.gz
tcl-9c989aeec930a9251ba5eddc6a81898a5c91ee0e.tar.bz2
Import of tommath 0.35
Diffstat (limited to 'libtommath/tombc')
-rw-r--r--libtommath/tombc/grammar.txt35
1 files changed, 35 insertions, 0 deletions
diff --git a/libtommath/tombc/grammar.txt b/libtommath/tombc/grammar.txt
new file mode 100644
index 0000000..a780e75
--- /dev/null
+++ b/libtommath/tombc/grammar.txt
@@ -0,0 +1,35 @@
+program := program statement | statement | empty
+statement := { statement } |
+ identifier = numexpression; |
+ identifier[numexpression] = numexpression; |
+ function(expressionlist); |
+ for (identifer = numexpression; numexpression; identifier = numexpression) { statement } |
+ while (numexpression) { statement } |
+ if (numexpresion) { statement } elif |
+ break; |
+ continue;
+
+elif := else statement | empty
+function := abs | countbits | exptmod | jacobi | print | isprime | nextprime | issquare | readinteger | exit
+expressionlist := expressionlist, expression | expression
+
+// LR(1) !!!?
+expression := string | numexpression
+numexpression := cmpexpr && cmpexpr | cmpexpr \|\| cmpexpr | cmpexpr
+cmpexpr := boolexpr < boolexpr | boolexpr > boolexpr | boolexpr == boolexpr |
+ boolexpr <= boolexpr | boolexpr >= boolexpr | boolexpr
+boolexpr := shiftexpr & shiftexpr | shiftexpr ^ shiftexpr | shiftexpr \| shiftexpr | shiftexpr
+shiftexpr := addsubexpr << addsubexpr | addsubexpr >> addsubexpr | addsubexpr
+addsubexpr := mulexpr + mulexpr | mulexpr - mulexpr | mulexpr
+mulexpr := expr * expr | expr / expr | expr % expr | expr
+expr := -nexpr | nexpr
+nexpr := integer | identifier | ( numexpression ) | identifier[numexpression]
+
+identifier := identifer digits | identifier alpha | alpha
+alpha := a ... z | A ... Z
+integer := hexnumber | digits
+hexnumber := 0xhexdigits
+hexdigits := hexdigits hexdigit | hexdigit
+hexdigit := 0 ... 9 | a ... f | A ... F
+digits := digits digit | digit
+digit := 0 ... 9