| | * sets the context tree to the root context node. |
| | * |
| | - * @param ctx The root context node. |
| | + * @param ctx The payload to transform. |
| | */ |
| | @Override |
| | public synchronized void enterRoot( QueryParser.RootContext ctx ) { |
| | setContextTree( createTree( ctx ) ); |
| | } |
| | |
| | /** |
| | - * Invoked when parsing <code>table > node</code>. Adds a new leaf to |
| | + * Invoked when parsing <code>table > path</code>. Adds a new leaf to |
| | * the context tree, then changes the context tree to the newly added leaf. |
| | + * |
| | + * @param ctx The payload to transform. |
| | */ |
| | @Override |
| | public synchronized void enterTableMap( QueryParser.TableMapContext ctx ) { |
| | setContextTree( addLeaf( ctx ) ); |
| | } |
| | |
| | /** |
| | - * Invoked when parsing <code>column > node</code>. Adds a new leaf to |
| | + * Invoked when parsing <code>column > path</code>. Adds a new leaf to |
| | * the context tree. |
| | + * |
| | + * @param ctx The payload to transform. |
| | */ |
| | @Override |
| | public synchronized void enterColumnMap( QueryParser.ColumnMapContext ctx ) { |
| | addLeaf( ctx ); |
| | } |
| | |
| | + /** |
| | + * Invoked when parsing <code>column > attribute</code>. Adds a new leaf |
| | + * to the context tree. |
| | + * |
| | + * @param ctx The payload to transform. |
| | + */ |
| | @Override |
| | public synchronized void enterAttributeMap( |
| | QueryParser.AttributeMapContext ctx ) { |
| | addLeaf( ctx ); |
| | } |
| | |
| | /** |
| | * Invoked when parsing <code>^</code>. Changes context tree to its parent. |
| | * If the parent doesn't exist, this will fail silently. |
| | + * |
| | + * @param ctx Indicates that context should switch, has no payload. |
| | */ |
| | @Override |
 |
| | /** |
| | * Invoked when there are no more <b>rxm</b> tokens to parse. |
| | + * |
| | + * @param ctx Indicates that the query has been parsed. |
| | */ |
| | @Override |
| | public synchronized void exitQuery( QueryParser.QueryContext ctx ) { |
| | - /* |
| | - push( "XMLROOT(" ); |
| | - push( String.format( "XMLELEMENT( NAME \"%s\"", root ) ); |
| | - |
| | - push( ")" ); |
| | - push( ", VERSION '1.0', STANDALONE YES)" ); |
| | - |
| | - String s = String.format( "XMLELEMENT( \"%s\" AS %s )", |
| | - ctx.getText(), "COLUMN" ); |
| | - push( s ); |
| | - String s = String.format( "XMLATTRIBUTES( %s AS \"%s\" )", |
| | - "COLUMN", ctx.getText().substring(1) ); |
| | - push( s ); |
| | - */ |
| | - |
| | System.out.println( getContextTree().getRoot().toString() ); |
| | } |