WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OpenPIE Engine design discussion
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    WiiLi.org Forum Index -> OpenPIE
View previous topic :: View next topic  
Author Message
Cha0s
Site Admin


Joined: 17 Jan 2007
Posts: 493

Digg It
PostPosted: Sun Nov 11, 2007 4:13 pm    Post subject:

Well, technically, in math for instance, they are not. An expression is one way of displaying something.

For instance, an expression for '5' is '2+3'. A statement involves making a claim. For instance, '5 = 2+3' is a statement. I don't care which syntax we use, as long as we pick one and stick to it.

The conflict I saw was this:
SweidshFrog wrote:
In this design, The parser would instead generate an object. The object inherits a class called Statement that has a method called execute(). In the code for the execute() method is where you'll find the "3 + 2" being evaluated. It's structured this way because it makes it trivial to point the iterator at a Statement object to execute its embedded code.


bellwethr wrote:
class AdditionExpression extends Expression {

Number term1;
Number term2;

public AdditionExpression(Number t1, Number t2) {
term1 = t1;
term2 = t2;
}


Number execute() {
return term1.value() + term2.value();
}

}


Those both seem to be the same thing, but they have different names. We need to pick one. And I concur, Statement/Expression should be an interface. You had referred to it as a class previously (and of things extending it), hence the confusion.
_________________
Cha0s
Back to top
View user's profile Send private message
bellwethr



Joined: 05 Nov 2007
Posts: 25

Digg It
PostPosted: Mon Nov 12, 2007 12:11 am    Post subject:

Agreed, re: Interface vs Class.

As for statement vs expression, my only concern is that we be consistent.

Expressions can be recursive, e.g. the AdditionExpression will have addends that are in turn each Expressions.

AssignmentExpressions will take a term (aka a variable) and assign an expression to it, etc.

Has any code at all been written so far? I'd like to peek at whatever exists.
Back to top
View user's profile Send private message
SwedishFrog
Site Admin


Joined: 25 Jan 2007
Posts: 273
Location: New York

Digg It
PostPosted: Wed Nov 14, 2007 6:05 pm    Post subject:

First off, I'd like to say that we could save alot of time if we get a library that provides us with the code-object structures. No need to re-invent the wheel. Post here if you learn anything about a lib we can use.

On statement vs expression -- I don't care what we call it either. It's it's pretty clear in context what we're talking about anyway.

As far as code goes, PM's are disabled so email me on myspace or something and I'll send you what we have so far, which is the JavaCC grammar. It's the product of lots of hours of tinkering by Luis with some basic guidance from me. It's pretty nice so far. I was reading through it the other day, lots of structures are already there.

Off the top of my head I know a few things that are missing are the actions (the generated java code that JavaCC outputs) and a definition for expression. I have somewhere a basic expression syntax that I wrote a while ago which we may use. However feel free to come up with your own stuff if you like.
Back to top
View user's profile Send private message Visit poster's website AIM Address
bellwethr



Joined: 05 Nov 2007
Posts: 25

Digg It
PostPosted: Sat Nov 17, 2007 12:51 am    Post subject:

I'm confused about what you mean regarding a library to build "code-objects."

I think I poorly explained it, but that's the job of the parser--building an object representation out of lexical tokens....

I'll send you a msg on myspace...
Back to top
View user's profile Send private message
SwedishFrog
Site Admin


Joined: 25 Jan 2007
Posts: 273
Location: New York

Digg It
PostPosted: Sat Nov 17, 2007 6:18 pm    Post subject:

Sorry, I really just don't know what I'm supposed to call those classes.

When I say we want a library for "code objects" I mean we want a set of classes which represent basic structures in programming code. It would include a class to represent If statements, a class for Assignment Statements, as well as loops and other common features of a programming language.

The parser pieces these objects together into a working abstraction of a program that runs in Java. This will be made easier if we do not write the classes that represent code. We could save time by finding a library. They exist already on .net (CodeDOM) but we want a library we can use freely on various platforms.

What should we refer to these classes as in the future?
Back to top
View user's profile Send private message Visit poster's website AIM Address
bellwethr



Joined: 05 Nov 2007
Posts: 25

Digg It
PostPosted: Sat Nov 17, 2007 10:36 pm    Post subject:

Ah, I see what you're getting at.

If a similar Java package existed, it would be useful, however I've not heard of anything like that for Java...

However, having built interpreters before, basic scripting operations are pretty straightforward to implement as objects.
Back to top
View user's profile Send private message
spety



Joined: 28 Dec 2006
Posts: 1

Digg It
PostPosted: Thu Nov 22, 2007 5:59 pm    Post subject:

Hello,

I'd like to interject a little side note here. One of my favorite features of glovePIE was it's ability to invoke all of the standard Win32API functions. I'm not a Java expert, but it would be unfortunate if the use of Java would prevent this kind of functionality.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> OpenPIE All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group