Git Product home page Git Product logo

spark-compiler-1's Introduction

Spark-Compiler

Grammar

_program -> _use_clause _program_body
_use_clause -> ("use" | "with") id _use_clause | $;
_program_body -> _program_specification "is" _basic_declaration "begin" _sequence_of_statements "end" id;
_program_specification -> "procedure" id | "function" id "return" id;
_basic_declaration -> id ":" ["constant"] _type_declaration [":=" _term] ";" _basic_declaration | $
_sequence_of_statements -> _statement _sequence_of_statements | $
_statement -> _assignement_statement | _if_statement | _boucle_statement | _switch_statement | _exit_statement | _null_statement
_assignement_statement -> IDF := _simple_expression ;
_if_statement -> "if" _condition "then" _sequence_of_statements _elsif_statements _if_aux "end if"
_elsif_statements -> "elsif" _condition "then" _sequence_of_statements _elsif_statements | $
_if_aux -> "else" _sequence_of_statements | $< br> _condition -> _relation _relation_aux
_relation-> simple_expression (=, /=, >, >=, <, <=) simple_expression | simple_expression [not] "in" (range | subtype_mark)
_relation_aux-> "and" _relation | "and" "then" _relation | "or" _relation | "or" "then" _relation | "xor" _relation | $
_simple_expression-> _term _simple_expression_aux
_simple_expression_aux ---> ("+" | "-" | "&") _term | epsilon
_term -> V_NULL | NUMERIC | DECIMAL | STRING_LITERAL | IDF
_boucle_statements -> _for_statements | _while_statements | _loop_statements
_for_statements -> "for" IDF "in" [REVERSE] NUMERIC "to" NUMERIC _loop_statements
_loop_statements -> "loop" _sequence_of_statements "end loop" ";"
_while_statements -> "while" _condition loop_statements
_null_statement-> "null" ";"
_exit_statement-> "exit" _exit_aux ";"
_exit_aux -> _when_statement | $
_when_statement -> "when" _condition ";"

Commands for executing the project

flex -l Scanner.l
gcc -c lex.yy.c
repete gcc -c for all c files
gcc -o test lex.yy.o (all .o files) -lfl
./test

spark-compiler-1's People

Contributors

anass-elghaoui avatar hamzaelhaddaoui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.