hectorpeeters / fontoxpath Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fontoxml/fontoxpath
A minimalistic XPath 3.1 implementation in pure JavaScript
License: MIT License
This project forked from fontoxml/fontoxpath
A minimalistic XPath 3.1 implementation in pure JavaScript
License: MIT License
Write tests for the annotation of the AST.
In TW Session 3 you give a presentation as a group in which you show your TW lecturer the progress you have made for the report so far. Please use the skills you have learnt in the Oral Presentations course part of Software Engineering Methods, Q2 (or part of OOP Project).
Upload the slides for this presentation.
Create annotations for VarRef expressions and integrate them into the AST
These are currently locked behind some changes to the static context and the scoping
The map of binary operator functions has to be expanded to annotate subtractions.
The isSubtypeOf
check is currently a recursive function that's not the fastest. This can be sped up a bit (making it O(1)) by taking the current types, calling isSubtypeOf
over all pairs of types and adding the true pairs into a set. This set could then be checked against with O(1) complexity.
Potentially this set can be cached to reduce overhead on application start, as the set should be a relatively small subset of all type combinations and the set creation is O(n^2)
This task is quite low priority and should only be implemented when we have time after implementing the rest, as it's nicely separated (it only requires changes within the isSubtypeOf
function) and not fundamental for our project.
isSubtypeOf
returns true.Since the structure of the IAST has been changed, tests that assert the intermediate AST will fail. This can be fixed by either changing the test assertions, or by not executing the type inference step when running these tests.
The earlier expressions still use raw array accessing instead of functions from astHelper.ts.
Cast operators need to be converted in roughly the same style as the binary operator.
At the moment with each new commit our overall coverage goes down. To bring it up again we should add some extra testing to make sure code paths that are not covered yet end up getting covered.
Coverage percentage should be 96%
or higher.
The ruleMap for binaryOperator is at the moment a map to retrieve both the type and function. This should be split up in 2 different maps.
Some annotations are still missing, which at the moment we assume to be undefined, while they should be item()*.
These should therefore be implemented and the reliant classes should keep this type in mind properly.
Some binary operators need a special function to get evaluated. This will need to get attached to the AST.
Individually, assess your draft report. Use this rubric to evaluate your own report.
As a group, write down three questions you have for your lecturer. You can ask these questions during Session 4.
Bundlemon is complaining since it's not setup properly. With the correct configuration, this can be fixed.
We have to integrate the type inference into the binary operator. This is done by taking out the type checks from the binaryoperator class and moving them to a separate function that embeds the types directly into the AST.
Now that we have the additional type information, we should use this to make sure all expressions have an early return if the type data is known. This will drastically speed up the whole execution.
Right now, the AST gets traversed manually using recursive switch statements and this happens multiple times throughout the codebase, it would probably be cleaner if we make a single AstVisitor class which can be used in both annotateAst and compileAstToExpression.
The map of binary operator functions has to be expanded to annotate divisions.
If we encounter an AST node which isn't supported while annotating, we don't descend down that branch. Due to this problem, some nodes which we can annotate don't get annotated.
Change the addOpannotation method to be a common module that can be used by other operators.
tl;dr polish the report and make sure that they match the expectations from the rubric.
The type annotations are now directly inserted into the AST as a separate XML node, however, they should ideally be attributes.
The type checking of the binary operators should be moved to the annotation phase, so that in most cases this does not need to happen during runtime.
In case no type could be inferred, dynamic type checking should be used as a fallback, so the original type checking code should not be removed completely.
Addition (a+b)
Subtraction (a-b)
Multiplication (a*b)
Division (a/b)
Integer division (a idiv b)
Modulus (a % b)
General:
Built in Functions are not getting annotated, that needs to be fixed.
At the moment we have 2 different maps but they still are used in the same place we need to split up functions so they only return relevant information
At the end of the project, we should have the type annotation implemented for many of the AST nodes as possible.
Fix the subtypechecking in the annotating of the ast.
Fix the bininary Operator annotation by using the checks made by fonto in binaryoperator.ts
Atomized tasks that cannot be broken down further.
as titled
The map of binary operator functions has to be expanded to annotate integer divisions.
We need to traverse the ast multiple times while annotating because of the way the prolog works. Find a way to implement flagging so parts of the ast that have been annotated aren't traversed multiple times.
The map of binary operator functions has to be expanded to annotate modulo operations.
Right now, some of the annotation code manually parses QNames form the AST. This can be cleaned up by using the existing helper functions.
Once you have given and received feedback from the BuddyCheck system, we would like you to write a reflection. For this assignment we expect you to reflect on this feedback from several different perspectives.
Your reflection should be between 500 and 1000 words in total.
During the meeting with the TA in week 6 all team members will be asked to discuss which skill they want to work on, this way the team can take each other’s goals in mind and help everyone improve their performance during the remaining weeks of the project.
The unary type now does a dynamic check for its type, this can be done during the AST annotation phase, so it should be moved there.
Plus
Minus (negation)
Implement type inference in comparison operator, the same way we did in binary operator. Only start when we are happy with binary operator as they are the same principle in implementation.
Make sure that the duplicate code in binary operator unary operator is gone
During annotation time, we place the evaluation function for binary operators in the AST. This is not ideal since the AST should easily be serializable which is not possible with functions. Thus the we should postpone this function attaching until we construct the actual expression.
Type inferring functions is not implemented yet.
Requires further specification.
Atomized tasks that cannot be broken down further.
tl;dr write the report as the university likes it
Resolve the different TODOs around the code base.
some of the TODOs can be searched using keyword TODO: Annotation not yet implemented
We want to know how well our implementation covers the queries, we want to keep track of how many annotations are made for a given query. A simple metric would be: annotations/nodes for a query.
The binary operator annotation at this moment is code copied straight out of binary operator this needs to be fixed.
Create annotations for FLWOR (For Let While Order Return) expressions and integrate them into the AST.
These are currently locked behind some changes to the static context and the scoping
The map of binary operator functions has to be expanded to annotate multiplications.
At the moment there aren't that many tests for the annotation of the code, this should be fixed.
Make sure variables and functions can have different scopings but still function correctly.
At the end of the project, we should have the type annotation implemented for many of the AST nodes as possible.
undefined
: Cannot be determined, needs to run XPath)Fix the typing of a iDivFunction
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.