All Downloads are FREE. Search and download functionalities are using the official Maven repository.

simple3.Simple3.grm Maven / Gradle / Ivy

"Name"    = 'Simple'
"Author"  = 'Devin Cook, Dave Dolan, Ralph Iden (comment support and fixed loop/while)'
"Version" = '3.1' 
"About"   = 'This is a very simple grammar designed for use in examples'

"Case Sensitive" = False 
"Start Symbol"   = 

{String Ch 1} = {Printable} - ['']
{String Ch 2} = {Printable} - ["]

Id            = {Letter}{AlphaNumeric}*

! String allows either single or double quotes

StringLiteral = ''   {String Ch 1}* ''
              | '"'  {String Ch 2}* '"'

NumberLiteral = {Digit}+('.'{Digit}+)?

Comment Start = '/*'
Comment End   = '*/'
Comment Line  = '//'

 ::=  
               |  

 ::= 
               | begin  end 

  ::= print  
               | print  read ID  
               | ID '='  
               | loop  until  
               | for '('  ';'  ';'  ')' do  end
               | while  do  end
               | if  then  end
               | if  then  else  end
               | function ID '('  ')' begin  end
               | return               

 ::= 
                      |

 ::= ID ',' 
              | ID

   ::=  '>'   
                 |  '<'   
                 |  '<='  
                 |  '>=' 
                 |  '==' 
                 |  '<>' 
                 |  

      ::=  '+' 
                 |  '-' 
                 |  '&' 
                 |  

    ::=  '*'  
                |  '/'  
                |  

  ::= '-'  
                |  

       ::= ID           
                | StringLiteral
                | NumberLiteral                
                | ID '('  ')'
                | '('  ')'
               
 ::= 
                |

 ::=  ',' 
                | 






© 2015 - 2025 Weber Informatics LLC | Privacy Policy