[0.1.08] - 2021-03-27
Loxxyimplements variable resolving and binding as described in Chapter 11 of "Crafting Interpreters" book.
New
- Class
BackEnd::Resolverimplements the variable resolution (whenever a variable is in use, locate the declaration of that variable)
Changed
- Class
Ast::Visitorchanges in some method signatures - Class
BackEnd::Enginenew attributeresolverthat points to aBackEnd::Resolverinstance - Class
BackEnd::Engineseveral methods dealing with variables have been adapted to take the resolver into account.
[0.1.07] - 2021-03-14
Loxxynow supports nested functions and closures
Changed
- Method
Ast::AstBuilder#reduce_call_exprnow supports nested call expressions (e.g.getCallback()();) - Class
BackEnd::Environment: added the attributespredecessorandembeddingto support closures. - Class
BackeEnd::LoxFunction: added the attributeclosurethat is equal to the environment where the function is declared. - Constructor
BackEnd::LoxFunction#newnow takes aBackEnd::Engineas its fourth parameter - Methods
BackEnd::SymbolTable#enter_environment,BackEnd::SymbolTable#leave_environmenttake into account closures.
Fixed
- Method
Ast::AstBuilder#after_var_stmtnow takes into account the value from the top of stack
[0.1.06] - 2021-03-06
- Parameters/arguments checks in function declaration and call
Changed
- Method
Ast::AstBuilder#reduce_call_arglistraises aLoxxy::RuntimeErrorwhen more than 255 arguments are used. Method
BackEnd::Engine#after_call_exprraises aLoxxy::RuntimeErrorwhen argument count doesn't match the arity of function.Class
BackEnd::Functionrenamed toLoxFunction
[0.1.05] - 2021-03-05
- Test for Fibbonacci recursive function is now passing.
Fixed
- Method
BackEnd::Function#calla call doesn't no more generate of TWO scopes
[0.1.04] - 2021-02-28
Added
- Class
Ast::LoxReturnStmta node that represents a return statement - Method
Ast::ASTBuilder#reduce_return_stmt - Method
Ast::ASTVisitor#visit_return_stmtfor visiting anAst::LoxReturnStmtnode - Method
BackEnd::Engine#after_return_stmtto handle return statement - Method
BackEnd::Function#!implementing the logical negation of a function (as value). - Test suite for logical operators (in project repository)
- Test suite for block code
- Test suite for call and function declaration (initial)
Changed
- Method
BackEnd::Engine#after_call_exprnow generate acatchandthrowevents
[0.1.03] - 2021-02-26
- Runtime argument checking for arithmetic and comparison operators
Added
- Test suite for arithmetic and comparison operators (in project repository)
- Class
BackEnd::UnaryOperator: runtime argument validation - Class
BackEnd::BinaryOperator: runtime argument validation
Changed
- File
consolerenamed toloxxy. Very basic command-line interface. - Custom exception classes
- File
README.mdupdated list of supportedLoxkeywords.
[0.1.02] - 2021-02-21
- Function definition and call documented in
README.md
Changed
- File
README.mdupdated description of function definition and function call.
Fixed
- Method
BackEnd::Engine#after_print_stmtnow handles of empty stack or nil data. - Method
BackEnd::Engine#after_call_exprwas pushing one spurious item onto data stack.
[0.1.01] - 2021-02-20
Fixed
- Fixed most offences for Rubocop.
[0.1.00] - 2021-02-20
- Version number bumped,
Loxxysupports function definitions
Added
- Class
Ast::LoxFunStmta node that represents a function declaration - Method
Ast::ASTBuilder#reduce_fun_decl - Method
Ast::ASTBuilder#reduce_functioncreates aLoxFunStmtinstance - Method
Ast::ASTBuilder#reduce_parameters_plus_morefor dealing with function parameters - Method
Ast::ASTBuilder#reduce_parameters_plus_end - Method
Ast::ASTVisitor#visit_fun_stmtfor visiting anAst::LoxFunStmtnode - Method
Ast::LoxBlockStmt#empty?returns true if the code block is empty - Method
BackEnd::Engine#after_fun_stmt - Method
Backend::NativeFunction#call - Method
Backend::NativeFunction#to_str - Method
Backend::Functionimplementation of a function object.
Changed
- Method
BackEnd::Engine#after_call_expr
Fixed
- Fixed inconsistencies in documentation comments.
[0.0.28] - 2021-02-15
- The interpreter implements function calls (to a native function).
Added
- Class
Ast::LoxCallExpra node that represents a function call expression - Method
Ast::ASTBuilder#reduce_call_expr - Method
Ast::ASTBuilder#reduce_refinement_plus_end - Method
Ast::ASTBuilder#reduce_call_arglistcreates aLoxCallExprnode - Method
Ast::ASTBuilder#reduce_arguments_plus_morebuilds the function argument array - Method
Ast::ASTVisitor#visit_call_exprfor visiting anAst::LoxCallExprnode - Method
BackEnd::Engine#after_call_exprimplements the evaluation of a function call. - Method
BackEnd::Engine#after_for_stmtimplements most of theforcontrol flow
[0.0.27] - 2021-01-24
- The interpreter implements
whileloops.
Added
- Class
Ast::LoxForStmta node that represents aforstatement - Method
Ast::ASTBuilder#reduce_for_stmt - Method
Ast::ASTBuilder#reduce_for_controlcreates anAst::LoxForStmtnode - Method
Ast::ASTVisitor#visit_for_stmtfor visiting anAst::LoxWhileStmtnode - Method
BackEnd::Engine#before_for_stmtbuilds a new environment for the loop variable - Method
BackEnd::Engine#after_for_stmtimplements most of theforcontrol flow
Changed
- File
README.mdupdated.
[0.0.26] - 2021-01-22
- The interpreter implements
whileloops.
Added
- Class
Ast::LoxWhileStmta node that represents awhilestatement - Method
Ast::ASTBuilder#reduce_while_stmtcreates anAst::LoxWhileStmtnode - Method
Ast::ASTVisitor#visit_while_stmtfor visiting anAst::LoxWhileStmtnode - Method
BackEnd::Engine#after_while_stmtimplements the while looping structure
Changed
- File
README.mdupdated.
[0.0.25] - 2021-01-21
- The interpreter implements blocks of code.
Added
- Class
Ast::LoxBlockStmta node that represents a block of code - Method
Ast::ASTBuilder#reduce_block_stmtcreates anAst::LoxBlockStmtnode - Method
Ast::ASTVisitor#visit_block_stmtfor visiting anAst::LoxBlockStmtnode - Method
BackEnd::Engine#before_block_stmtcreates an new enclosed Environment - Method
BackEnd::Engine#after_block_stmtclose enclosed Environment and make parent Environment the current one
Changed
- File
README.mdupdated.
[0.0.24] - 2021-01-20
- The interpreter implements the assignment of variables.
Added
- Class
Ast::LoxAssignExpra node that represents the assignment of a value to a variable - Method
Ast::ASTBuilder#reduce_assign_exprcreates anAst::LoxAssignExprnode - Method
Ast::ASTVisitor#visit_assign_exprfor visiting anAst::LoxAssignExprnode - Method
BackEnd::Engine#after_assign_exprimplementation of the assignment - Method
BackEnd::Variable#assignto assign a value to a variable
[0.0.23] - 2021-01-20
- Fix for variables without explicit initialization.
Added
- Method
Ast::ASTVisitor#visit_builtinfor visitingDatatype::BuiltinDatatypevalue. - Method
BackEnd::Engine#before_visit_builtinpush the data value onto the stack.
Fixed
- Method
Ast::LoxVarStmt#initialize: in case no explicit value provided then useDatatype::Nil.instanceinstead of Rubynil
[0.0.22] - 2021-01-17
- The interpreter can retrieve the value of a variable.
Added
- Method
Ast::ASTBuilder#declaration_plus_moreandAst::ASTBuilder#declaration_plus_endto allow multiple expressions/statements - Method
Ast::ASTBuilder#reduce_var_expressioncreates anAst::LoxVariableExprnode - Method
Ast::ASTVisitor#visit_var_exprfor visitingAst::LoxVariableExprnodes - Class
Ast::LoxSeqDecla node that represents a sequence of declarations/statements - Class
Ast::LoxVarExpra node that represents a variable occurrence in an expression - Method
Engine::after_variable_expr: retrieve the value of variable with given name
Changed
- Method
Ast::ASTBuilder#reduce_lox_programto support multiple statements/declarations - File
README.mdupdated.
[0.0.21] - 2021-01-16
- The interpreter supports the declaration global variables.
Added
- Class
BackEnd::Entry, mixin module for objects put in the symbol table - Class
BackEnd::Environmentthat keeps track of variables in a given context. - Class
BackEnd::SymbolTablethat keeps track of environments. - Class
BackEnd::Variableinternal representation of aLoxvariable - Method
Ast::ASTBuilder#reduce_var_declarationandAst::ASTBuilder#reduce_var_declaration - Method
Ast::ASTVisitor#visit_var_stmtfor visitingLoxVarStmtnodes - Attribute
Engine::symbol_tablefor keeping track of variables - Method
Engine::after_var_stmtfor the implementation of variable declarations
[0.0.20] - 2021-01-15
- The interpreter supports the
if...elsestatement.
Added
- Class
Ast::LoxItStmt, AST node specific forifelsestatements - Method
Ast::ASTBuilder#reduce_if_stmtas semantic action for if ... else - Method
Ast::ASTVisitor#visit_if_stmtfor visitingLoxIfStmtnodes - Method
Engine::after_if_stmtimplementation of the control flow
[0.0.19] - 2021-01-14
- The interpreter supports expressions between parentheses (grouping).
Added
- Class
Ast::LoxLogicalExpr - Method
Ast::ASTBuilder#reduce_grouping_expras semantic action for grouping expression - Method
Ast::ASTVisitor#visit_grouping_exprfor visiting grouping expressions - Method
Engine::after_grouping_exprfor the evaluation of grouping expressions
Changed
- File
grammar.rbrules for if ... else were given names in order to activate semantic actions. - File
README.mdupdated with littleif ... elsedocumentation.
[0.0.18] - 2021-01-13
- The interpreter can evaluate
and,orexpressions.
Added
- Class
Ast::LoxLogicalExpr - Method
Ast::ASTBuilder#reduce_logical_exprfor the semantic action require forand,or - Method
Ast::ASTVisitor#visit_logical_exprfor visiting logical expressions - Method
Backend::Engine#after_logical_exprimplements the evaluation of the logical expressions
[0.0.17] - 2021-01-12
- The interpreter can evaluate all arithmetic and comparison operations.
- It implements
==,!=and the unary operations!,-
Added
- Class
Ast::LoxUnaryExpr - Method
Ast::ASTBuilder#reduce_unary_exprto support the evaluation of!and `-@ - Method
Ast::ASTVisitor#visit_unnary_exprfor visiting unary expressions - Method
Backend::Engine#after_unary_exprevaluating an unary expression - In class
Datatype::BuiltinDatatypethe methodsfalsey?,truthy?,!,!= - In class
Datatype::Numberthe methods<,<=, ´>´,>=and-@
Changed
- File
README.mdupdated.
[0.0.16] - 2021-01-11
- The interpreter can evaluate product and division of two numbers.
- It also implements equality
==and inequality!=operators
Added
- Method
Datatype::False#==for equality testing - Method
Datatype::False#!=for inequality testing - Method
Datatype::LXString#==for equality testing - Method
Datatype::LXString#!=for inequality testing - Method
Datatype::Nil#==for equality testing - Method
Datatype::Nil#!=for inequality testing - Method
Datatype::Number#==for equality testing - Method
Datatype::Number#!=for inequality testing - Method
Datatype::Number#*for multiply operator - Method
Datatype::Number#/for divide operator - Method
Datatype::True#==for equality testing - Method
Datatype::True#!=for inequality testing
Changed
- Method
BackEnd::Engine#after_binary_exprto allow*,/,==,!=operators - File
README.mdupdated for the newly implemented operators
[0.0.15] - 2021-01-11
- The interpreter can evaluate substraction between two numbers.
Added
- Method
Datatype::Number#-implementing the subtraction operation
Changed
- File
README.mdminor editorial changes. - File
lx_string_spec.rbAdded test for string concatenation - File
number_spec.rbAdded tests for addition and subtraction operations - File
interpreter_spec.rbAdded tests for subtraction operation
[0.0.14] - 2021-01-10
- The interpreter can evaluate addition of numbers and string concatenation
Added
- Method
Ast::ASTVisitor#visit_binary_exprfor visiting binary expressions - Method
Ast::LoxBinaryExpr#acceptfor visitor pattern - Method
BackEnd::Engine#after_binary_exprto trigger execution of binary operator Booleanclass hierarchy: added methostrue?andfalse?to ease spec test writing- Method
Datatype::LXString#+implementation of the string concatenation - Method
Datatype::Number#+implementation of the addition of numbers
Changed
- File
interpreter_spec.rbAdded tests for addition operation and string concatenation
[0.0.13] - 2021-01-10
- The interpreter can evaluate directly simple literals.
Changed
- Class
AST::ASTBuilderaddedreduce_exprStmtto support the evaluation of literals. - File
README.mdadded one more example. - File
parser_spec.rbUpdated the tests to reflect the change in the AST. - File
interpreter_spec.rbAdded a test for literal expression.
Fixed
- File
loxxy.rb: shorthand methodlox_truereferenced the ... false object (oops).
[0.0.12] - 2021-01-09
- Initial interpreter capable of evaluating a tiny subset of Lox language.
Added
- Class
AST::LoxNoopExpr - Class
AST::LoxPrintStmt - Class
BackEnd::Engineimplementation of the print statement logic - Class
Interpreter
Changed
- Class
Ast::ASTVisitorAdded visit method - File
README.mdadded Hello world example.
[0.0.11] - 2021-01-08
- AST node generation for logical expression (and, or).
Changed
- Class
AST::ASTBuilderaddedreduce_methods for logical operations. - File
grammar.rbadded name to logical expression rules - File
README.mdadded gem version and license badges, expanded roadmap section.
Fixed
- File
grammar.rb: a rule had incomplete non-terminal nameconjunct_in its lhs.
[0.0.10] - 2021-01-08
- AST node generation for equality expression.
Changed
- Class
AST::ASTBuilderrefactoring and addedreduce_methods for equality operations. - File
grammar.rbadded name to equality rules - File
README.mdadded gem version and license badges, expanded roadmap section.
Fixed
- File
grammar.rb: a rule had still the discarded non-terminalequalityTest_starin its lhs.
[0.0.9] - 2021-01-07
- AST node generation for comparison expression.
Changed
- Class
AST::ASTBuilderaddedreduce_methods for comparison operations. - File
grammar.rbadded name to comparison rules
[0.0.8] - 2021-01-07
- AST node generation for arithmetic operations of number literals.
Changed
- Class
AST::ASTBuilderaddedreduce_methods for arithmetic operations. - File
grammar.rbadded name to arithmetic rules
Fixed
- File
grammar.rb: second rule forfactorhad a missing member in rhs.
[0.0.7] - 2021-01-06
- Lox grammar reworked, initial AST classes created.
Added
- Class
Parserthis one generates AST's (Abstract Syntax Tree) - Class
AST::ASTVisitordraft initial implementation. - Class
AST::BinaryExprdraft initial implementation. - Class
AST::LoxCompoundExprdraft initial implementation. - Class
AST::LiteralExprdraft initial implementation. - Class
AST::LoxNodedraft initial implementation.
Changed
- File
spec_helper.rb: removed Bundler dependency - Class
AST::ASTBuilderadded initialreduce_methods. - File
README.mdRemoved example with AST generation since this is in flux.
[0.0.6] - 2021-01-03
- First iteration of a parser with AST generation.
Added
- Class
Parserthis one generates AST's (Abstract Syntax Tree) - Class
AST::ASTBuilderdefault code to generate an AST.
Changed
- File
spec_helper.rb: removed Bundler dependency - File
README.mdAdded example with AST visualization.
Fixed
- File
grammar.rbensure that the constantGrammaris created once only.
[0.0.5] - 2021-01-02
- Improved example in
README.md, code re-styling to pleaseRubocop1.7
Changed
- Code re-styling to please
Rubocop1.7 - File
README.mdImproved example with better parse tree visualization.
[0.0.4] - 2021-01-01
- A first parser implementation able to parse Lox source code.
Added
- Method
LXString::==equality operator.
Changed
- class
Parserrenamed toRawParser - File
README.mdAdded an example showing the use ofRawParserclass.
[0.0.3] - 2020-12-29
- Scanner can recognize strings and nil tokens ### Added
- class
Datatype::Nilfor representing nil tokens in Lox - class
Datatype::LXStringfor representing Lox strings
Changed
- Method
BuilinDatatype::validated_valuenow accepts the input value as is. Frontend::Scannerupdated code to recognize strings and nil- File
scanner_spec.rbAdded tests for strings, nil scanning
[0.0.2] - 2020-12-28
- Scanner can recognize keywords, boolean and numbers ### Added
Datatypemodule and classes
Changed
Frontend::Scannerupdated code to recognize booleans and numbers- File
scanner_spec.rbAdded tests for keywords, booleans and number scanning - File
README.mdfixed a couple of typos.
[0.0.1] - 2020-12-27
Added
- Initial Github commit