001 /*
002 [Adapted from BSD licence]
003 Copyright (c) 2002 Terence Parr
004 All rights reserved.
005
006 Redistribution and use in source and binary forms, with or without
007 modification, are permitted provided that the following conditions
008 are met:
009 1. Redistributions of source code must retain the above copyright
010 notice, this list of conditions and the following disclaimer.
011 2. Redistributions in binary form must reproduce the above copyright
012 notice, this list of conditions and the following disclaimer in the
013 documentation and/or other materials provided with the distribution.
014 3. The name of the author may not be used to endorse or promote products
015 derived from this software without specific prior written permission.
016
017 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
018 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
019 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
020 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
021 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
022 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
023 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
024 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
026 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027 */
028 package gate.wiki.antlr;
029
030 public class DBGTarget extends NOPTarget implements YAMTarget {
031
032 public String getTargetLanguage() {
033 return "DBG";
034 }
035
036 /** insert head.html if found */
037 public void begin() {
038 }
039
040 /** insert tail.html if found */
041 public void end() {
042 }
043
044 public void text(String t) {
045 System.out.println("[<TEXT> " + t + "]");
046 }
047
048 public void bold(String t) {
049 System.out.println("[<BOLD> " + t + "]");
050 }
051
052 public void italic(String t) {
053 System.out.println("[<ITALIC> " + t + "]");
054 }
055
056 public void tt(String t) {
057 System.out.println("[<TT> " + t + "]");
058 }
059
060 public void begin_ul(int level) {
061 System.out.println("[<UL:" + level + ">]");
062 }
063
064 public void begin_ol(int level) {
065 System.out.println("[<OL:" + level + ">]");
066 }
067
068 public void end_ul(int level) {
069 System.out.println("[</UL:" + level + ">]");
070 }
071
072 public void end_ol(int level) {
073 System.out.println("[</OL:" + level + ">]");
074 }
075
076 public void beginListItem(int level) {
077 System.out.println("[<LI:" + level + ">]");
078 }
079
080 public void paragraph() {
081 System.out.println("[<P>]");
082 }
083
084 public void linebreak() {
085 System.out.println("[<BR>]");
086 }
087
088 public void blankline() {
089 System.out.println("[<BR><BR>]");
090 }
091
092 public void code(String c) {
093 System.out.println("[<CODE> " + c + "]");
094 }
095
096 public void verbatim(String rawOutput) {
097 write(rawOutput);
098 }
099
100 public void blockquote(String q) {
101 System.out.println("[<BLOCKQUOTE> " + q + "]");
102 }
103
104 public void link(String url, String title) {
105 System.out.println("[<LINK> " + url + ", " + title + "]");
106 }
107
108 public void section(String title, int level) {
109 System.out.println("[<SECTION>:" + level + ": " + title + "]");
110 }
111
112 public void col() {
113 }
114
115 public void row() {
116 }
117
118 public void begin_table() {
119 }
120
121 public void end_table() {
122 }
123
124 }
|