Hello,

This is my first update of the project for implementing a parser and an
evaluator for schema component designators. Up to now, I have completed
setting up my development environment and started to looking into the code.
Then I wrote a tokenizer for SCP, using javacc and tested it. Since SCP has
a very simple grammar and javacc seems to produce a huge amount of code,
Sandy (my mentor) suggested that using Javacc would be an overkill to
achieve this simple task (the task of parsing an SCP string). Then we
decided to write the parser by hand so that it will be more concise, easier
to maintain and understand etc.

I talked with Sandy, and we came up with the following plan for next week.

I will start to implement the SCD class. For that, I will use the existing
XPath class as a model and use its format in the SCD class as well. For
example, I will implement a method that has the similar functionality to
that of the XPath class' parseExpression() method. In addition to that, I
will look into the XPath class and extract what code can be shared between
it and the SCP class(for example NameTest) and make it into a separate unit.

For the API, we are suggesting following methods
Constructors:
SCP(scpString);         // for expressions like /p:a/p:b
SCP(scpString, namespaceContext); // for expressions like
xmlns(p=ns)xscd(/p:a/p:b)

methods:
1 XSObjectList resolve(relativeSCD)
2 XSObjectList resolve(scp, namespaceContext)

private methods:
3 Step[]             getSteps(); // for parsing
4 Iterator<Step> iterator()

During next week, I am focusing on completing the constructors and the
second and the third methods.

the Step class represents a step in a given SCP. For example, if we take the
SCP
/a/b/c/@d,
a, b, c and d are four steps. A step is of the form {SchemaElement "a"}
where SchemaElement represents the type of the step. It can be either an
axis, a name test, or a predicate. Further more, we will define an
enumeration type to identify different types of axis types.

In addition to that, the Step class will have following methods
getAxisType()
getQName()
getPredicate()


-- 
Best Regards,
Ishan Jayawardena.

Reply via email to