View previous topic :: View next topic |
Author |
Message |
luke
Joined: 05 Jun 2007 Posts: 5
|
Posted: Thu Jul 26, 2007 1:09 am Post subject: Interesting project - need help? |
|
|
Hi
I just started with D and would like to participate in a project.
Is there a task I could do?
greez
luke |
|
Back to top |
|
|
grignaak
Joined: 25 May 2007 Posts: 9 Location: Seattle
|
Posted: Fri Aug 10, 2007 1:05 pm Post subject: |
|
|
Oh hey! There's a forum! I didn't know....
So, yes. I would like to have help. Right now, though, I am in the design phase (which is going slowly b/c I'm at an internship @ amazon.com). Currently I am sifting through the spec at yaml.org and trying to remove garbage productions.
My (current) idea is first to implement it using tango Fibers, and then restructure it using a state machine.
I will then (maybe) put a DOM, and a lightweight DOM on top of the parser.
--Michael |
|
Back to top |
|
|
grignaak
Joined: 25 May 2007 Posts: 9 Location: Seattle
|
Posted: Sat Aug 11, 2007 1:18 am Post subject: |
|
|
You know, come to think of it...
I could use a set of test cases to begin with. Would you want to start out by designing and coding some? There are a whole slew of examples in the specification if you wanted to create a set of yaml->expected files.
In the next few days I'll be nailing down the API. I could also use feedback/insights on that. Your ideas would be great.
Thank you
--Michael |
|
Back to top |
|
|
luke
Joined: 05 Jun 2007 Posts: 5
|
Posted: Mon Aug 13, 2007 1:30 am Post subject: |
|
|
Oh, hi there!
I was already thinking, it nowone here...
Test cases, you say? Can you be a little more concrete?
When you talk about test cases, i think of something like this:
When i feed file xyz.yml into your lib and ask it to list its contents, i get an exact copy, ommitting the comments.
When i feed file gigantic_yaml_file.yml into your lib it works no more than 20secs on a 2GHz/1GByte machine.
something like this? |
|
Back to top |
|
|
grignaak
Joined: 25 May 2007 Posts: 9 Location: Seattle
|
Posted: Mon Aug 13, 2007 2:59 am Post subject: |
|
|
Here is what I am thinking:
One approach to test the lib is to take a series of yaml files to test, each with two corresponding files for the Lexer/Parser test. The files could be a line separated list of Tokens/Events that could be compared against the lib's output.
For example:
testA.yaml:
Code: | my list:
- item a
- item b |
testA.lex:
Code: | my
[space]
list
[colon]
[newline]
... |
testA.parse:
Code: | BEGIN_MAP
MAP_KEY
SCALAR "my list"
BEGIN_VALUE
BEGIN_LIST
BEGIN_VALUE
SCALAR "item a"
BEGIN_VALUE
SCALAR "item b"
END_LIST
END_MAP |
Another approach may be to use a Mock Object. This may come in handy later for the DOM builder built on top of the Parser.
Once again, I get to solidify the API to the lib. I have my thoughts temporarily stored as a (very incomplete) rough draft in the wiki. Feel free to comment - I'm always open to suggestions. Once the API is solid, unit tests on each of the pieces can be written (fairly) independently of the lib itself.
Also here's a reference JSON parser being built in Apache Labs
I have the lexer written, and I just found out where the repository is, so that will be checked in soon.
Regarding comments: I think I might want to maybe possibly have comments as a switchable parser event. This will allow a program to read in a file, change it, and re-output it while still keeping the user's comments. They would be switched off by default though, of course.
What do you think of all this?
--Michael |
|
Back to top |
|
|
luke
Joined: 05 Jun 2007 Posts: 5
|
Posted: Tue Aug 14, 2007 11:00 am Post subject: |
|
|
So you want to construct the test cases as files. How about creating them on demand, using a reference library?
I think the lib for python would do the trick, and we would be able to test anything we find on the net.
Another thing: Are you able to grant me some access to your wiki? (no need for full access, just to be able to do something) |
|
Back to top |
|
|
grignaak
Joined: 25 May 2007 Posts: 9 Location: Seattle
|
Posted: Tue Aug 14, 2007 5:48 pm Post subject: |
|
|
luke wrote: | So you want to construct the test cases as files. How about creating them on demand, using a reference library?
I think the lib for python would do the trick, and we would be able to test anything we find on the net. |
That's OK by me.
Quote: | Another thing: Are you able to grant me some access to your wiki? (no need for full access, just to be able to do something) |
Done. |
|
Back to top |
|
|
|