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

simple2.Simple2a.grm Maven / Gradle / Ivy

"Name"    = 'Simple'
"Author"  = 'Devin Cook'
"Version" = '2.0' 
"About"   = 'This is a very simple grammar designed for use in examples'

"Case Sensitive" = False 
"Start Symbol"   = 

Comment Block @= { Nesting = All, Advance = Character }

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

Comment Line  = '//'

{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}+)?

 ::=  
               | 

  ::= display 
               | display  read ID
               | assign ID '=' 
               | while  do  end
               | if  then  end
               | if  then  else  end
               
   ::=  '>'   
                 |  '<'   
                 |  '<='  
                 |  '>=' 
                 |  '==' 
                 |  '<>' 
                 |  

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

    ::=  '*'  
                |  '/'  
                |  

  ::= '-'  
                |  

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy