Merge lp:~oontvoo/cfg-to-pda/clean-mvn into lp:cfg-to-pda
- clean-mvn
- Merge into trunk
Proposed by
Vy Nguyen
Status: | Merged |
---|---|
Merged at revision: | 5 |
Proposed branch: | lp:~oontvoo/cfg-to-pda/clean-mvn |
Merge into: | lp:cfg-to-pda |
Diff against target: |
358 lines (+291/-2) 8 files modified
.bzrignore (+14/-0) pom.xml (+125/-0) src/main/java/api/Language.java (+20/-0) src/main/java/api/Machine.java (+20/-0) src/main/java/cfgpda/Cfg.java (+20/-0) src/main/java/cfgpda/Pda.java (+22/-0) src/main/javacc/CFGGrammar.jj (+38/-2) src/test/java/cfgpda/RunConverter.java (+32/-0) |
To merge this branch: | bzr merge lp:~oontvoo/cfg-to-pda/clean-mvn |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vy Thuy Nguyen | Pending | ||
Review via email: mp+130285@code.launchpad.net |
Commit message
Description of the change
clean up
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file '.bzrignore' |
2 | --- .bzrignore 1970-01-01 00:00:00 +0000 |
3 | +++ .bzrignore 2012-10-18 05:39:22 +0000 |
4 | @@ -0,0 +1,14 @@ |
5 | +./classes |
6 | +./target |
7 | +./.classpath |
8 | +./.project |
9 | +build.properties.local |
10 | +ParseException.java |
11 | +CFGGrammar.java |
12 | +CFGGrammarConstants.java |
13 | +CFGGrammarTokenManager.java |
14 | +Token.java |
15 | +*.iml |
16 | +*.ipr |
17 | +*.iws |
18 | + |
19 | |
20 | === modified file 'pom.xml' |
21 | --- pom.xml 2012-10-18 03:49:39 +0000 |
22 | +++ pom.xml 2012-10-18 05:39:22 +0000 |
23 | @@ -22,4 +22,129 @@ |
24 | <scope>test</scope> |
25 | </dependency> |
26 | </dependencies> |
27 | + |
28 | + <build> |
29 | + <plugins> |
30 | + <!-- Compile for Java 6 --> |
31 | + <plugin> |
32 | + <groupId>org.apache.maven.plugins</groupId> |
33 | + <artifactId>maven-compiler-plugin</artifactId> |
34 | + <version>2.3.2</version> |
35 | + <configuration> |
36 | + <source>1.6</source> |
37 | + <target>1.6</target> |
38 | + </configuration> |
39 | + </plugin> |
40 | + <!-- Build source jar --> |
41 | + <plugin> |
42 | + <groupId>org.apache.maven.plugins</groupId> |
43 | + <artifactId>maven-source-plugin</artifactId> |
44 | + <version>2.1.2</version> |
45 | + <executions> |
46 | + <execution> |
47 | + <id>attach-sources</id> |
48 | + <phase>package</phase> |
49 | + <goals> |
50 | + <goal>jar</goal> |
51 | + </goals> |
52 | + </execution> |
53 | + </executions> |
54 | + </plugin> |
55 | + <!-- JavaCC plugin --> |
56 | + <plugin> |
57 | + <groupId>org.codehaus.mojo</groupId> |
58 | + <artifactId>javacc-maven-plugin</artifactId> |
59 | + <version>2.6</version> |
60 | + <executions> |
61 | + <execution> |
62 | + <id>javacc</id> |
63 | + <goals> |
64 | + <goal>javacc</goal> |
65 | + </goals> |
66 | + <configuration> |
67 | + </configuration> |
68 | + </execution> |
69 | + </executions> |
70 | + </plugin> |
71 | + <!-- Unit tests --> |
72 | + <plugin> |
73 | + <groupId>org.apache.maven.plugins</groupId> |
74 | + <artifactId>maven-surefire-plugin</artifactId> |
75 | + <version>2.11</version> |
76 | + <configuration> |
77 | + <includes> |
78 | + <include>**/*Test.java</include> |
79 | + </includes> |
80 | + </configuration> |
81 | + </plugin> |
82 | + <!-- Generate test-jar --> |
83 | + <plugin> |
84 | + <groupId>org.apache.maven.plugins</groupId> |
85 | + <artifactId>maven-jar-plugin</artifactId> |
86 | + <version>2.2</version> |
87 | + <executions> |
88 | + <execution> |
89 | + <goals> |
90 | + <goal>test-jar</goal> |
91 | + </goals> |
92 | + </execution> |
93 | + </executions> |
94 | + </plugin> |
95 | + <plugin> |
96 | + <groupId>com.atlassian.maven.plugins</groupId> |
97 | + <artifactId>maven-clover2-plugin</artifactId> |
98 | + <version>3.0.1</version> |
99 | + <configuration> |
100 | + <generateHistorical>true</generateHistorical> |
101 | + <historyDir>/clover/history</historyDir> |
102 | + <license>${clover.license}</license> |
103 | + <generateXml>true</generateXml> |
104 | + </configuration> |
105 | + </plugin> |
106 | + <plugin> |
107 | + <groupId>org.codehaus.mojo</groupId> |
108 | + <artifactId>findbugs-maven-plugin</artifactId> |
109 | + <version>1.2</version> |
110 | + <configuration> |
111 | + <findbugsXmlOutput>true</findbugsXmlOutput> |
112 | + <findbugsXmlWithMessages>true</findbugsXmlWithMessages> |
113 | + <xmlOutput>true</xmlOutput> |
114 | + </configuration> |
115 | + </plugin> |
116 | + <plugin> |
117 | + <groupId>com.mycila.maven-license-plugin</groupId> |
118 | + <artifactId>maven-license-plugin</artifactId> |
119 | + <version>1.10.b1</version> |
120 | + <configuration> |
121 | + <header>src/etc/header.txt</header> |
122 | + <strictCheck>true</strictCheck> |
123 | + <failIfMissing>true</failIfMissing> |
124 | + <excludes> |
125 | + <!-- General files that can't have or don't need header --> |
126 | + <exclude>**/*.sql</exclude> |
127 | + <exclude>**/*.expected</exclude> |
128 | + <exclude>**/*.error</exclude> |
129 | + <exclude>**/*.jj</exclude> |
130 | + <exclude>**/*.features</exclude> |
131 | + <exclude>.bzrignore</exclude> |
132 | + <exclude>.idea/**</exclude> |
133 | + <exclude>LICENSE.txt</exclude> |
134 | + <exclude>target/generated-sources/javacc/cfgpda/*.java</exclude> |
135 | + <exclude>target/**</exclude> |
136 | + </excludes> |
137 | + <mapping> |
138 | + <g>JAVADOC_STYLE</g> |
139 | + <yml>SCRIPT_STYLE</yml> |
140 | + </mapping> |
141 | + </configuration> |
142 | + <executions> |
143 | + <execution> |
144 | + <goals> |
145 | + <goal>check</goal> |
146 | + </goals> |
147 | + </execution> |
148 | + </executions> |
149 | + </plugin> |
150 | + </plugins> |
151 | + </build> |
152 | </project> |
153 | |
154 | === modified file 'src/main/java/api/Language.java' |
155 | --- src/main/java/api/Language.java 2012-10-18 04:55:27 +0000 |
156 | +++ src/main/java/api/Language.java 2012-10-18 05:39:22 +0000 |
157 | @@ -1,3 +1,23 @@ |
158 | +/** |
159 | + * Context-Free-Grammar to Push-down Automaton Converter |
160 | + * Copyright (C) 2012 Vy Nguyen |
161 | + * |
162 | + * This library is free software; you can redistribute it and/or |
163 | + * modify it under the terms of the GNU Library General Public |
164 | + * License as published by the Free Software Foundation; either |
165 | + * version 2 of the License, or (at your option) any later version. |
166 | + * |
167 | + * This library is distributed in the hope that it will be useful, |
168 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
169 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
170 | + * Library General Public License for more details. |
171 | + * |
172 | + * You should have received a copy of the GNU Library General Public |
173 | + * License along with this library; if not, write to the |
174 | + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
175 | + * Boston, MA 02110-1301, USA. |
176 | + */ |
177 | + |
178 | package api; |
179 | |
180 | /** |
181 | |
182 | === modified file 'src/main/java/api/Machine.java' |
183 | --- src/main/java/api/Machine.java 2012-10-18 04:55:27 +0000 |
184 | +++ src/main/java/api/Machine.java 2012-10-18 05:39:22 +0000 |
185 | @@ -1,3 +1,23 @@ |
186 | +/** |
187 | + * Context-Free-Grammar to Push-down Automaton Converter |
188 | + * Copyright (C) 2012 Vy Nguyen |
189 | + * |
190 | + * This library is free software; you can redistribute it and/or |
191 | + * modify it under the terms of the GNU Library General Public |
192 | + * License as published by the Free Software Foundation; either |
193 | + * version 2 of the License, or (at your option) any later version. |
194 | + * |
195 | + * This library is distributed in the hope that it will be useful, |
196 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
197 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
198 | + * Library General Public License for more details. |
199 | + * |
200 | + * You should have received a copy of the GNU Library General Public |
201 | + * License along with this library; if not, write to the |
202 | + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
203 | + * Boston, MA 02110-1301, USA. |
204 | + */ |
205 | + |
206 | package api; |
207 | |
208 | /** |
209 | |
210 | === modified file 'src/main/java/cfgpda/Cfg.java' |
211 | --- src/main/java/cfgpda/Cfg.java 2012-10-18 04:55:27 +0000 |
212 | +++ src/main/java/cfgpda/Cfg.java 2012-10-18 05:39:22 +0000 |
213 | @@ -1,3 +1,23 @@ |
214 | +/** |
215 | + * Context-Free-Grammar to Push-down Automaton Converter |
216 | + * Copyright (C) 2012 Vy Nguyen |
217 | + * |
218 | + * This library is free software; you can redistribute it and/or |
219 | + * modify it under the terms of the GNU Library General Public |
220 | + * License as published by the Free Software Foundation; either |
221 | + * version 2 of the License, or (at your option) any later version. |
222 | + * |
223 | + * This library is distributed in the hope that it will be useful, |
224 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
225 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
226 | + * Library General Public License for more details. |
227 | + * |
228 | + * You should have received a copy of the GNU Library General Public |
229 | + * License along with this library; if not, write to the |
230 | + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
231 | + * Boston, MA 02110-1301, USA. |
232 | + */ |
233 | + |
234 | package cfgpda; |
235 | |
236 | import api.Language; |
237 | |
238 | === modified file 'src/main/java/cfgpda/Pda.java' |
239 | --- src/main/java/cfgpda/Pda.java 2012-10-18 04:55:27 +0000 |
240 | +++ src/main/java/cfgpda/Pda.java 2012-10-18 05:39:22 +0000 |
241 | @@ -1,5 +1,27 @@ |
242 | +/** |
243 | + * Context-Free-Grammar to Push-down Automaton Converter |
244 | + * Copyright (C) 2012 Vy Nguyen |
245 | + * |
246 | + * This library is free software; you can redistribute it and/or |
247 | + * modify it under the terms of the GNU Library General Public |
248 | + * License as published by the Free Software Foundation; either |
249 | + * version 2 of the License, or (at your option) any later version. |
250 | + * |
251 | + * This library is distributed in the hope that it will be useful, |
252 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
253 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
254 | + * Library General Public License for more details. |
255 | + * |
256 | + * You should have received a copy of the GNU Library General Public |
257 | + * License along with this library; if not, write to the |
258 | + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
259 | + * Boston, MA 02110-1301, USA. |
260 | + */ |
261 | +package cfgpda; |
262 | + |
263 | import api.Machine; |
264 | |
265 | + |
266 | /** |
267 | * |
268 | * @author Vy Thuy Nguyen |
269 | |
270 | === added directory 'src/main/java/cfgpda/parser' |
271 | === added directory 'src/main/java/cfgpda/std' |
272 | === modified file 'src/main/javacc/CFGGrammar.jj' |
273 | --- src/main/javacc/CFGGrammar.jj 2012-10-18 04:09:12 +0000 |
274 | +++ src/main/javacc/CFGGrammar.jj 2012-10-18 05:39:22 +0000 |
275 | @@ -20,5 +20,41 @@ |
276 | |
277 | /** |
278 | * Define grammar for specifying a Context-Free-Grammar's rules to be converted |
279 | - * to a PDA |
280 | - */ |
281 | \ No newline at end of file |
282 | + * to a PDA |
283 | + * |
284 | + * All upercase letters are `variables` |
285 | + * Anything else (lowercase and symbol) is considered `terminal` |
286 | + */ |
287 | + |
288 | +options |
289 | +{ |
290 | + // multiple instances are allowed |
291 | + STATIC = false ; |
292 | +} |
293 | + |
294 | +PARSER_BEGIN(CFGGrammar) |
295 | + |
296 | +package cfgpda; |
297 | + |
298 | +class CFGGrammar |
299 | +{ |
300 | + public static void main( String[] args ) throws ParseException, TokenMgrError |
301 | + { |
302 | + CFGGrammar parser = new CFGGrammar( System.in ); |
303 | + parser.Start(); |
304 | + } |
305 | +} |
306 | +PARSER_END(CFGGrammar) |
307 | + |
308 | +void Start(): |
309 | +{ |
310 | +} |
311 | +{ |
312 | + <NUMBER> |
313 | + ( <PLUS> <NUMBER>)* |
314 | + <EOF> |
315 | +} |
316 | + |
317 | +SKIP : {" " | "\n" | "\r" | "\r\n"} |
318 | +TOKEN : { <PLUS: "+">} |
319 | +TOKEN : { <NUMBER: (["0"-"9"])+ >} |
320 | |
321 | === added directory 'src/test/java' |
322 | === added directory 'src/test/java/cfgpda' |
323 | === added file 'src/test/java/cfgpda/RunConverter.java' |
324 | --- src/test/java/cfgpda/RunConverter.java 1970-01-01 00:00:00 +0000 |
325 | +++ src/test/java/cfgpda/RunConverter.java 2012-10-18 05:39:22 +0000 |
326 | @@ -0,0 +1,32 @@ |
327 | +/** |
328 | + * Context-Free-Grammar to Push-down Automaton Converter |
329 | + * Copyright (C) 2012 Vy Nguyen |
330 | + * |
331 | + * This library is free software; you can redistribute it and/or |
332 | + * modify it under the terms of the GNU Library General Public |
333 | + * License as published by the Free Software Foundation; either |
334 | + * version 2 of the License, or (at your option) any later version. |
335 | + * |
336 | + * This library is distributed in the hope that it will be useful, |
337 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
338 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
339 | + * Library General Public License for more details. |
340 | + * |
341 | + * You should have received a copy of the GNU Library General Public |
342 | + * License along with this library; if not, write to the |
343 | + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
344 | + * Boston, MA 02110-1301, USA. |
345 | + */ |
346 | + |
347 | +package cfgpda; |
348 | + |
349 | + |
350 | +public class RunConverter |
351 | +{ |
352 | + public static void main (String args[]) |
353 | + { |
354 | + |
355 | +// CFGGrammar gram = new CFGGrammar("2 + 2"); |
356 | + |
357 | + } |
358 | +} |