diff options
author | Steven R. Brandt <sbrandt@cct.lsu.edu> | 2012-02-06 15:39:05 -0600 |
---|---|---|
committer | Steven R. Brandt <sbrandt@cct.lsu.edu> | 2012-02-06 15:39:05 -0600 |
commit | 412670ec56e30fed32b43fb6fc05a3f0314dd44c (patch) | |
tree | 15d965c640574b15ea115a492cd5d39dcc4754cf /Auxiliary | |
parent | 9f7490779a625560785cf4e03d16fb3302949c9c (diff) |
latest to parse Funwave.kranc
Diffstat (limited to 'Auxiliary')
-rw-r--r-- | Auxiliary/Grammars/kranc2.peg | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Auxiliary/Grammars/kranc2.peg b/Auxiliary/Grammars/kranc2.peg index 29ce154..e078f7e 100644 --- a/Auxiliary/Grammars/kranc2.peg +++ b/Auxiliary/Grammars/kranc2.peg @@ -7,10 +7,10 @@ indices = ([_^]({index_symbol}|\({index_expr}(,{index_expr})*\))+)* index_symbol = [a-zA-Z]'* index_expr = {index_symbol}([+-]{int}|) tensor = {name}{indices} -dtensor = D[a-z]*{indices}? {tensor} +dtensor = D[a-z0-9]*{indices}? {tensor} number = -?[0-9]+(\.[0-9]*|)([eEdD][+-]?[0-9]+|) func = {name} \( ({expr}( , {expr})*|) \) -value = {func}|{dtensor}|{tensor}|{number}|\( {expr} \) +value = {func}|{dtensor}|-?{tensor}|{number}|-?\( {expr} \) pow = {value}( \*\* {value}|) mulop = [*/%] mul = {pow}( {mulop} {pow})* @@ -20,11 +20,12 @@ eqn = ({dtensor}|{tensor}) \= {expr}{-end} deqn = {dtensor} \= {expr}{-end} eqns = {eqn}( {eqn})* deqns = {deqn}( {deqn})* -schedule = scheduled[ \t]+at[ \t]{uname} +at_or_in = (at|in) +schedule = scheduled[ \t]+{at_or_in}[ \t]{uname} thorn = begin[ ]+thorn {name}{-end}( {calculation}| {variables}| {temporaries}| {derivatives}| {option})* end[ ]+thorn calculation = begin[ \t]+calculation[ \t]+{uname}[ \t]+{schedule}{-end} {eqns} end[ \t]+calculation -variables = begin[ \t]+variables{-end} {tensor}( end[ \t]+variables\b{brk}| {tensor})*{-end} -temporaries = begin[ \t]+temporaries{-end} {tensor}( end[ \t]+temporaries\b{brk}| {tensor})*{-end} +variables = begin[ \t]+variables{-end} ( end[ \t]+variables\b{brk}| {tensor})*{-end} +temporaries = begin[ \t]+temporaries{-end} ( end[ \t]+temporaries\b{brk}| {tensor})*{-end} option = {inherit}|{use}|{disable}|{implement} inherit = inherit[ \t]+({uname}[ \t]*)+{-end} feature = loopcontrol|vectors|opencl|jacobian|cse |