001/* 002 * Copyright (C) 2009-2011 Mathias Doenitz 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.parboiled.annotations; 018 019import org.parboiled.parserunners.RecoveringParseRunner; 020import org.parboiled.parserunners.RecoveringParseRunner; 021 022import java.lang.annotation.ElementType; 023import java.lang.annotation.Retention; 024import java.lang.annotation.RetentionPolicy; 025import java.lang.annotation.Target; 026 027/** 028 * <p>Annotation that can be used on the parser class itself. 029 * Instructs parboiled to build a parse tree during a parsing run. When this annotation is present on the parser class 030 * the parse tree building can be further tweaked by decorating certain rules with {@link SuppressNode}, 031 * {@link SuppressSubnodes} and/or {@link SkipNode}. When this annotation is not present on the parser class the listed 032 * rule annotations do not have any effect because no parse tree is build at all.</p> 033 * <p>Note: If the input contains parse errors and you use the {@link RecoveringParseRunner} parboiled 034 * will create parse tree nodes for all rules that have recorded parse errors (note that this always includes the root 035 * rule)</p> 036 */ 037@Retention(RetentionPolicy.RUNTIME) 038@Target({ElementType.TYPE}) 039public @interface BuildParseTree { 040}