meevee98 / pnp Goto Github PK
View Code? Open in Web Editor NEWThis project forked from joaofouyer/pnp
PNP is not Pseudocode
License: MIT License
This project forked from joaofouyer/pnp
PNP is not Pseudocode
License: MIT License
I'm converting everything to Kotlin because I was having too many problems with Null Pointer Exception with Java. #1 is the current list of what has to be done for now.
While is everything being refactored, should be good to check the current behaviour of the relational operations in the semantic phase.
Relational Operations:
Do-While is one of the control flow statements that consists in the repetition of a block of instruction while the given Boolean condition is false. The difference between it and the while statement is that while has a pre-condition and do-while has a pos-condition. That means that the do-while statement executes its block of instructions at least once.
This is the syntax of the do-while loop in the PNP language:
repita
<block of instructions>
ate que <condition>;
The Java implementation that it's been refactored already have an implementation of the do-while statement. We have to refactor it to Kotlin too.
The switch is one of the control flow statements that which perform different computations depending on the value of the given variable.
This is the syntax of the switch statement in the PNP language:
caso <variable> seja
<value-1>: <block of instructions when variable = value1>
<value-2>: <block of instructions when variable = value2>
<value-2>: <block of instructions when variable = value3>
senao: <block of instructions default>
fim
The default branch can be omitted. A switch statement can have multiple branches. Each branch can only be computed if its respective condition value is true and all the other branches won't be computed. The computation of the switch statement is very similar to an if statement #11. The equivalent of the switch example in an if statement is as follows:
se (variable = value1) entao
<block of instructions when variable = value1>
senao se (variable = value2) entao
<block of instructions when variable = value2>
senao se (variable = value3) entao
<block of instructions when variable = value3>
senao
<block of instructions default>
fim
The main purpose of this project is to implement a compiler to the language we created. The compiler is a translator: it gets the code written in a language and translates it to another language. The most known compilers usually translate a programming language to a machine language.
Our compiler is under construction and the first purpose is to translate code written in PNP to Web Assembly Text Format.
I was thinking that we should also implement an interpreter to PNP language. Different from the compiler, an interpreter executes the code directly. This way, the final user can write codes in PNP and effectively execute then. I could be able only to read files or could have a user interface too.
While is one of the control flow statements that consists in the repetition of a block of instruction while the given Boolean condition is true.
This is the syntax of the while loop in the PNP language:
enquanto <condition> faca
<block of instructions>
fim
The Java implementation that it's been refactored already have an implementation of the while statement. We have to refactor it to Kotlin too.
I'm converting everything to Kotlin because I was having too many problems with Null Pointer Exception with Java. #1 is the current list of what has to be done for now.
While is everything being refactored, should be good to check the current behaviour of the arithmetic operations in the semantic phase.
Arithmetic Operations:
If is one of the control flow statements that which perform different computations depending on the value of the given Boolean condition.
This is the syntax of the if statement in the PNP language:
se <condition> entao
<block of instructions when the condition is true>
senao
<block of instructions when the condition is false>
fim
The else branch can be omitted. An if statement can have multiple branches. Each branch can only be computed if its respective condition value is true and all the other branches won't be computed.
se <condition-1> entao
<block of instructions when the condition-1 is true>
senao se <condition-2> entao
<block of instructions when only the condition-2 is true>
senao se <condition-3> entao
<block of instructions when only the condition-3 is true>
senao
<block of instructions when all conditions are false>
fim
For is one of the control flow statements that consists in the repetition of a block of instruction a given number of times.
This is the syntax of the for loop in the PNP language:
para <control-variable> de <initial-value> ate <final-value> passo <increment-value> repita
<block of instructions>
fim
Following that syntax, the for-loop iteration can start and end at any value since the values have both the same type. The step of increment can be omitted with the default value of 1.
para <control-variable> de <initial-value> ate <final-value> repita
<block of instructions>
fim
I'm converting everything to Kotlin because I was having too many problems with Null Pointer Exception with Java. #1 is the current list of what has to be done for now.
While is everything being refactored, should be good to check the current behaviour of the relational operations in the semantic phase.
Relational Operations:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.