Skip to content

GayeYilmaz/yacc-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quarantine
I named to this langugae as Quarantine because of our quarantine life.I made this project on my own.
UPDATED GRAMMAR
<program>::=<function>
<function>::=<function><statement>
<statement>::=<expression>
  |PRINT <expression>
  |VARIABLE <expression>
  |WHILE "(" <expression> ")" <statement>
  |IF "("<expression>")" <statemnet> ELSE <statement>
  | "{"<statementList>"}"
  |COMMENT
  
<statementList>::=<statement>
  |<statementList>
 

<expression>::=INTEGER
  |VARIABLE
  |<expression> "+" <expression>
  |<expression> "-" <expression>
  |<expression> "*" <expression>
  |<expression> "^" <expression>
  |<expression> "<" <expression>
  |<expression> ">" <expression>
  |<expression> "<=" <expression>
  |<expression> ">=" <expression>
  |<expression> "!=" <expression>
  |<expression> "==" <expression>
  |"("<expression>")"
 
  PRINT=print
  VARIABLE=[a-z]
  WHILE=while
  IF=if
  ELSE=else
  COMMENT= "/*"([^*]|\*+[^*/])*\*+"/"
    |[//][^\r\n]*
  INTEGER [1-9][0-9]*
    |0
    
 My language no longer different from the C language.But I don't need data type like int or bool.You have to end every code statement with ";" and for the loop loop body should 
 be in between "{" and "}".Yo can write comment in two ways first one "//" starting with this all line runnin as a comment and the other one is "/*....*/" in this sign every
 character will be run as a comment.
 
 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published