Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/petru-braha/c-yoda-syntax
A simple conversion of code-text into a speech reversed veritable :)
https://github.com/petru-braha/c-yoda-syntax
Last synced: about 2 months ago
JSON representation
A simple conversion of code-text into a speech reversed veritable :)
- Host: GitHub
- URL: https://github.com/petru-braha/c-yoda-syntax
- Owner: petru-braha
- Created: 2024-09-02T19:20:11.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-09-08T17:43:25.000Z (5 months ago)
- Last Synced: 2024-09-08T19:18:18.364Z (5 months ago)
- Language: C++
- Homepage:
- Size: 15.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yoda notation
input: large text
output: same text with `conditions` - correct accidental assignements in code
## conditions
- centred only on the following relational operators: `=` `==` `!=`
- in an expression, the order of parameters is: `constant then object`
- no modifications for `constant then constant` statements
- a `constant` is a rvalue, anything like:
- const primitive/non-primitive
- pointer to functions
- preprocessed variables
- typeid
- statements to consider: `if` `while` `for` `condition operator - ?`## steps
- assume there are no syntax/semantic errors
- store constant names
- read the text in chunks
- modify each chunk individually, if needed
- determine accidental assignments and ask the user for improvement
- print on standard output the result## log
- no: discard any adjustment if the output of the code is different
- no: other operators => redability, purposeless
- no: run an entire project
- i assumed that every operator problem can appear only in if while for ? statements. it was wrong
- inspiration
- https://www.geeksforgeeks.org/what-is-the-efficient-way-of-reading-a-huge-text-file/
- https://cplusplus.com/forum/unices/13699/