aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary
diff options
context:
space:
mode:
authorSteven R. Brandt <sbrandt@cct.lsu.edu>2012-01-27 16:25:04 -0600
committerSteven R. Brandt <sbrandt@cct.lsu.edu>2012-01-27 16:25:04 -0600
commit966c1927241051d844d30bbd6306a08b8121310d (patch)
treecb47aa4f9275730612aa3ab96eb757556229e393 /Auxiliary
parentce30d6dec9c0a8a2824d2a425e3487412ec17766 (diff)
Added support for variables and temporaries
Diffstat (limited to 'Auxiliary')
-rw-r--r--Auxiliary/Grammars/kranc2.peg8
1 files changed, 5 insertions, 3 deletions
diff --git a/Auxiliary/Grammars/kranc2.peg b/Auxiliary/Grammars/kranc2.peg
index 7017b42..15c183c 100644
--- a/Auxiliary/Grammars/kranc2.peg
+++ b/Auxiliary/Grammars/kranc2.peg
@@ -6,7 +6,7 @@ indices = ([_^]([a-zA-Z]'*)+)*
tensor = {name}{indices}
dtensor = D{indices} {tensor}
number = -?[0-9]+(\.[0-9]*|)([eEdD][+-]?[0-9]+|)
-func = {name} \( {expr} \)
+func = {name} \( ({expr}( , {expr})*|) \)
value = {func}|{dtensor}|{tensor}|{number}|\( {expr} \)
pow = {value}( \*\* {value}|)
mulop = [*/%]
@@ -15,5 +15,7 @@ addop = [+-]
expr = {mul}( {addop} {mul})*
eqn = ({dtensor}|{tensor}) \= {expr}{-end}
eqns = {eqn}( {eqn})*
-thorn = begin[ ]+thorn {name}{-end}( {calculation})* end[ ]+thorn
-calculation = begin[ ]+calculation {uname}{-end} {eqns} end[ ]+calculation
+thorn = begin[ ]+thorn {name}{-end}( {calculation}| {variables}| {temporaries})* end[ ]+thorn
+calculation = begin[ \t]+calculation[ \t]+{uname}{-end} {eqns} end[ \t]+calculation
+variables = begin[ \t]+variables{-end} {name}( end[ \t]+variables\b{brk}| {name})*{-end}
+temporaries = begin[ \t]+temporaries{-end} {name}( end[ \t]+temporaries\b{brk}| {name})*{-end}