kcecireyes / jit Goto Github PK
View Code? Open in Web Editor NEWJit is a programming language for journalists
Jit is a programming language for journalists
"Make the language more a translator than an interpreter: python generation over python evaluation"
"Important: import the necessary libraries and print them out to the file beforehand."
Two considerations:
- Are we generating the right python?
- Are we outputting the desired output?
"After the parser/lexer, one person mapped out the functionality of the language to the functions needed in python to get it working, pretty much a map or menu of what goes with what."
Create an AST to do type checking and semantic checking [before translation to python].
Type checking and scope checking: traverse the tree and add information as you go: a table (dictionary, matrix data structure) of the variables that are in scope and types. For any given line, check whether vars are in scope and types for operations (int + int, etc)
Symbol table:
When you get to a var declaration, add the function or whatever is in scope to the table, pass it down to the next node. When it goes out of scope, stop the branch.
Create an AST to do type checking and semantic checking [before translation to python].
Type checking and scope checking: traverse the tree and add information as you go: a table (dictionary, matrix data structure) of the variables that are in scope and types. For any given line, check whether vars are in scope and types for operations (int + int, etc)
Symbol table:
When you get to a var declaration, add the function or whatever is in scope to the table, pass it down to the next node. When it goes out of scope, stop the branch.
"The database is not a key part of the project but it's necessary to have it to test the language, so get this working fast and soon. Graph algorithms should also work for testing soon."
this is so I will be able to do this, for production ID EQUALS expression:
elif len(p) == 4:
# ID EQUALS expression
if isinstance(p[3], str):
p[3] = AstString(p[3])
p[0] = AstBinOp(AstID(p[1]), p[2], p[3])
# Semantic Checking:
var_name = p[1]
var_type = p[3].type # need dis
var_record = {'name': var_name, 'type': var_type }
j = Parser.ST.searchRecord(var_name)
if j == -1:
print "Semantic error: Initialization without declaration"
else:
if (Parser.ST.getRecordType(j) is var_type):
self.ST.updateRecord(j,var_record) # same type updating, good
else:
print "Semantic error: Type mismatch in redeclared variable " + var_name
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.