keenlearner Posted September 1, 2007 Share Posted September 1, 2007 Hello, I want to make a documentation for my application. There will be many functions, if user want to know how to use a certain function, he has to refer to EBNF grammar. E.g one of EBNF grammar for evaluating arithmetic expression. (* ae short for arithmetic expressions if you are not sure the EBNF you might one to take a quick view from http://en.wikipedia.org/wiki/Ebnf *) ae = ae, (binary operator, ae)* ae = prefix function, ae ae = ae, postfix function ae = "(" ae ")" ae = NUMBER | CONSTANT binary operator = "+" | "-" | "*" | "/" | "%" | "^" prefix function = "sin" | "cos" | "tan" NUMBER = INTEGER | FLOAT CONSTANT = "pi" | "e" INTEGER = ["+" | "-"] DIGIT (* and so on *) so as I said there are many functions, the above one is one of them, when I want to write the EBNF of other function, I might be using some of the expression above all over again, especially the NUMBER, INTEGER. You can also see that there is a parent and child relation of NUMBER with FLOAT, INTEGER. So I want anyone's advices on how should I design the table structure or fields, to keep all the repetitive EBNF expression ? Thank you. Quote Link to comment Share on other sites More sharing options...
fenway Posted September 4, 2007 Share Posted September 4, 2007 Well, it's just basically a hierarchy... so you need a list of all of the possible pieces, then a parent_child relationship for each possible child (number and const for ae, for example), and then you'd need to "lookup" each child to see if it matches another item, and then lookup it's relationships, etc. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.