Home | Trees | Indices | Help |
|
---|
|
object --+ | LogicParser
Instances of this class are used to parse logic strings into abstract syntax trees, and then logic groups. This aims to provide robust parsing of logic strings, with the ability to identify syntax errors in such strings.
|
|||
|
|||
intermine.constraints.CodedConstraint |
|
||
int |
|
||
LogicGroup |
|
||
|
|||
list |
|
||
LogicGroup |
|
||
Inherited from |
|
|||
ops =
|
|
|||
Inherited from |
|
ConstructorParsers need access to the query they are parsing for, in order to reference the constraints on the query.
|
Get the constraint with the given codeThis method fetches the constraint from the parent query with the matching code.
See Also: intermine.query.Query.get_constraint |
Get the priority for a given operatorOperators have a specific precedence, from highest to lowest:
This method returns an integer which can be used to compare operator priorities.
|
Parse a logic string into an abstract syntax treeTakes a string such as "A and B or C and D", and parses it into a structure which represents this logic as a binary abstract syntax tree. The above string would parse to "(A and B) or (C and D)", as AND binds more tightly than OR. Note that only singly rooted trees are parsed.
|
Check the syntax for errors before parsingSyntax is checked before parsing to provide better errors, which should hopefully lead to more informative error messages. This checks for:
|
Convert a list of infix tokens to postfix notationTake in a set of infix tokens and return the set parsed to a postfix sequence.
|
Convert a set of structured tokens to a single LogicGroupConvert a set of tokens in postfix notation to a single LogicGroup object.
|
|
ops
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Mar 21 13:40:33 2013 | http://epydoc.sourceforge.net |