narratr's People
narratr's Issues
Test lexer and parser for all sample programs on LRM/Tutorial
Error Recovery for assigned functions
for parser and codegen
Sample Program: Key/Lock
- objects
- how to automatically use key that works with appropriate lock
- operations: pickup/use
Grammar & running a Hello World program
statements, statement, simple statement, start state, direction list, direction
Corresponding codegen
Sample Program: ponies!!
- loops
- variables declared only once
- explicit delete in cleanup
- miscellaneous
Implement symbol table in parser
Error Recovery for assigned functions
in parser and codegen
what we support in python
- arithmetic
- if constructions
- loops
what else?
expand narratr.py
program block, blocks, optional newlines, newlines, item block, block statement, if statement, elif statement
functions in parser.py
Create a test suite for PEP8 style checking
call list, number, args, arithmetic, term, factor, atom
corresponding codegen
Code Cleanup in codegen.py
Codegen needs to be cleaned up before others also start working on it, else it could become more confusing for everyone. Specifically,
- Comments. All logic, especially that which could be difficult for others to understand should be well commented - especially in detecting direction and moving around.
- Fixing PEP8 style errors. nosetests should pass.
- Removing deugging print statements. There are quite a few of them.
- Fix and remove code that is commented out. No code should be commented out without a specific stated reason.
Comments in the commits need to addressed here. Maybe redundant from above.
899d141
869f939
Sample Program: Hello World
- scene structure: setup/action/cleanup
- win/lose
Write bad programs and make sure they raise errors
Error catching and reporting in lexer
Test suite for the parser - with the sample programs
Please also check the parse tree. Don't take the current parse tree as correct.
Looping constructs
@nivvedan , this is your decision to make, but I figured everyone should be aware.
We never really decided what loop constructs we are going to support. I was thinking for
and while
, but should we support a do-while
loop? I have also tentatively made the syntax as follows:
for [var] in [list]:
[actions]
while [conditional]:
[actions]
They're obviously based on Python's. Let me know if you have suggestions.
Error Recovery for assigned functions
for parser and codegen
Sample Program: Moving Around
- numbering of scenes
- exposition
- operations: investigate, move, arithmetic
Code review - Except Jonah's
Code review - Except Nivvedan's
Expand on the Style Guide
Code Gen functions, listed below
test, and_test, not_test, comparison, comparison_op, arithmetic_expression, term, power, atom
moves declaration, move to statement, test list
program block, blocks, optional newlines, newlines, item block, block statement, if statement, , elif statement
corresponding codegen
Parser AST errors
Rough codegen.py review
First time using issue, hope I used it in a right way. Can you guys take a look at codegen.py? I mentioned some points here: 869f939
I didn't do pep8 style check yet...
Thanks!
scene block, setup block, action block, cleanup block
corresponding codegen
boilerplate "response" code
preprocessing, etc
p_expression, boolean expression, boolean term, boolean factor, boolean
functions in parser.py
Error Recovery for assigned functions
In parser and codegen
Line information in parser
The AST node should have line and column information
Update get_response to include the move command.
It is currently in action().
p_expression, boolean expression, boolean term, boolean factor, boolean
corresponding codegen
writing sample programs
Parser syntax errors
statements, statement, simple statement, start state, direction list, direction
functions in parser.py
clean up AST structure
i.e. develop an ideal structure (and implement it). this will make the code generator much more efficient (and easier to write), since it will have to do a lot less searching for nodes.
Probably @nivvedan and myself.
call list, number, args, arithmetic, term, factor, atom
functions in parser.py
Removing len(p) testing
All len(p) testing in the parser should be abandoned in favour of testing for p[i].type
Symbol table is not used while building the AST
Need to detect certain errors like scene/variable/item redeclaration while building the AST.
SymTab also make life of CodeGen easier.
scene block, setup block, action block, cleanup block
functions in parser.py
item_block in codegen
- program
- newlines_optional
- newlines
- blocks
- scene_block
- item_block (this is going to be somewhat involved, I think)
- start_state
- setup_block
- action_block
- cleanup_block
break statement, continue statement, while statement
or test, and test, not test, comparison
flow statement, power, trailer, strings
Default extension to .ntr.py instead if .ntrrc
It is very helpful for two reasons:
- Syntax highlighting in Text Editors when we want to look at the target code generated,
- Double Click to execute - Now THAT's useful.
Error Recovery for assigned functions
for parser and codegen
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.