Skip to content

Commit 61e2ba2

Browse files
author
Mike Klimek
committed
Merge pull request #19 from Tetr4/dependencies
Dependencies
2 parents cfb3ed8 + 7d3ca7f commit 61e2ba2

File tree

16 files changed

+66
-272
lines changed

16 files changed

+66
-272
lines changed

.classpath

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
<classpath>
33
<classpathentry kind="src" path="src"/>
44
<classpathentry kind="src" path="test"/>
5-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
65
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
7-
<classpathentry kind="lib" path="lib/jewelcli-0.6.jar"/>
6+
<classpathentry kind="lib" path="lib/jewelcli-0.8.9.jar"/>
7+
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.8.11.2.jar"/>
8+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
89
<classpathentry kind="output" path="bin"/>
910
</classpath>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
22
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
33
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_AFTER_CLEAN_TARGETS" value="sableCC,"/>
4+
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/>
45
<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_MANUAL_TARGETS" value="sableCC,"/>
56
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
67
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
7-
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${project}"/>
8+
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/compiler/analysis&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/compiler/lexer&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/compiler/node&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/compiler/parser&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/constants/analysis&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/constants/lexer&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/constants/node&quot; type=&quot;2&quot;/&gt;&#10;&lt;item path=&quot;/arden2bytecode/src/arden/constants/parser&quot; type=&quot;2&quot;/&gt;&#10;&lt;/resources&gt;}"/>
89
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
910
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
1011
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
1112
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="arden2bytecode"/>
1213
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
1314
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/arden2bytecode/build.xml}"/>
14-
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
15+
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,clean"/>
1516
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
1617
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/arden2bytecode}"/>
1718
</launchConfiguration>

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
/src/arden/constants/lexer
88
/src/arden/constants/node
99
/src/arden/constants/parser
10+
/tools/
11+
/lib/
1012
/dist/
1113
/report/
14+

.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<buildSpec>
88
<buildCommand>
99
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
10-
<triggers>full,incremental,</triggers>
10+
<triggers>clean,full,incremental,</triggers>
1111
<arguments>
1212
<dictionary>
1313
<key>LaunchConfigHandle</key>

.settings/org.eclipse.jdt.core.prefs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
44
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5-
org.eclipse.jdt.core.compiler.compliance=1.6
5+
org.eclipse.jdt.core.compiler.compliance=1.7
66
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
77
org.eclipse.jdt.core.compiler.debug.localVariable=generate
88
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
@@ -78,7 +78,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
7878
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
7979
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore
8080
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
81-
org.eclipse.jdt.core.compiler.source=1.6
81+
org.eclipse.jdt.core.compiler.source=1.7
8282
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
8383
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
8484
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -150,9 +150,12 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
150150
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
151151
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
152152
org.eclipse.jdt.core.formatter.indentation.size=4
153+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
153154
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
154-
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
155+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
156+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
155157
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
158+
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
156159
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
157160
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
158161
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert

LICENSE.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ But until this happens, this Arden Compiler as a whole is using the GNU GPL.
1717
Daniel Grunwald, 4th May 2010
1818

1919

20-
Libraries Used in Arden2ByteCode
21-
--------------------------------
22-
23-
Arden2ByteCode as of the repository forked by Hannes Flicka
24-
(hflicka on GitHub) uses the JewelCLI binary distribution which
25-
is licensed under the terms of the Apache License version 2.0.
26-
The Apache License is found in the accompanying file `jewelcli-license.txt`
27-
28-
2920
Arden2ByteCode License Text
3021
---------------------------
3122

README.md

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,36 @@ Arden2ByteCode - Compiler for Arden Syntax with Java Bytecode output
33

44
Copyright 2009-2010, Daniel Grunwald , 2011-2012, Hannes Flicka
55
Portions (arden.scc) Copyright 2004, University of British Columbia
6-
See LICENSE.txt for licensing information.
6+
See LICENSE.md for licensing information.
77

8-
Building Notes
9-
--------------
108

11-
To compile Arden2ByteCode, you first need to generate the parser using
12-
the SableCC parser generator.
13-
To do this, run
14-
`java -classpath ../tools/sablecc.jar org.sablecc.sablecc.SableCC arden.scc`
15-
in the arden2bytecode/src directory.
16-
This will create the directories `analysis`,`lexer`,`node`,`parser` within
17-
`arden2bytecode/src/arden`.
9+
Dependencies
10+
------------
1811

19-
When the input grammar is changed, you will need to re-generate the parser.
20-
Before regenerating the parser, you should delete the old `analysis`,`lexer`,
21-
`node`,`parser` directories to ensure there aren't any old files left behind.
12+
The dependencies are downloaded automatically if you use [Ant](https://ant.apache.org/) or [Eclipse](https://eclipse.org/) to build the project. See the "dependencies" target in [build.xml](build.xml) for download links.
2213

23-
If you use Eclipse to build, compiling the parser is done automatically.
24-
The Eclipse project has a SableCC builder in Project -> Properties -> Builders.
25-
The SableCC builder of the project basically starts the Ant task `sableCC`
26-
contained in build.xml.
27-
As building the parser has only to be done initially and after changes of
28-
the grammar, you can disable the SableCC builder if you want to save time.
14+
- [SableCC](http://www.sablecc.org/): A "compiler-compiler" which is used to generate the arden parser from a grammar file. Usage: `java -jar tools/sablecc.jar -d src/ src/arden.scc src/ardenConstants.scc`
15+
- [JewelCli](http://jewelcli.lexicalscope.com/): A command line arguments parser.
16+
- [JUnit](http://junit.org/): A testing framework to test the correct implementation and standard compliance.
17+
- [Hamcrest-core](http://hamcrest.org/JavaHamcrest/): Used with JUnit to create short and concise tests.
2918

30-
If you use Ant to build, SableCC is started automatically. Again, if you want
31-
to save time, you can disable the `sableCC` target by removing the `sableCC`
32-
dependency from the `compile` target.
3319

20+
Building
21+
--------
22+
To compile Arden2ByteCode, you first need to generate the parser using the SableCC parser generator.
3423

35-
Building Howto
36-
--------------
24+
To build the parser with **Eclipse**, import the project and choose *Project* &rArr; *Build project* from the menu. On the first build you need to refresh the Project (F5), so Eclipse finds the downloaded dependencies.
25+
To build with **Ant**, `cd` into the project root and type `ant` at the command prompt.
3726

38-
To build with Eclipse, import the project and choose
39-
Project -> Build project... from the menu.
27+
Both will automatically call the "sableCC" target in the [build.xml](build.xml) and generate the .java files for the parser in the packages `analysis`, `lexer`, `node`, `parser`. This can take some time, but will only happen if the .java files do not exist or are out-of-date.
4028

41-
To build with Ant, cd into the source root and type `ant` at the command
42-
prompt.
29+
When the input grammar is changed, you will need to regenerate the parser. Before regenerating the parser, you should call the "clean" target (*Project* &rArr; *Clean&hellip;*) to ensure there aren't any old files left behind.
4330

44-
This is explained in detail in the project's wiki at GitHub:
45-
https://github.com/hflicka/arden2bytecode/wiki/Getting-Started-with-Arden2ByteCode
31+
32+
Usage
33+
-----
34+
35+
This is explained in detail in the wiki: [Getting started with Arden2ByteCode](https://github.com/PLRI/arden2bytecode/wiki/Getting-started-with-Arden2ByteCode)
4636

4737

4838
Notes to the Present Implementation
@@ -58,7 +48,7 @@ Languages features not implemented:
5848
* 11.2.2 Event Statement
5949
* 13 Evoke Slot
6050
* From Arden Syntax 2.5 specification:
61-
* 11.2.5.2 Message As statement
51+
* 11.2.5.2 Message As statement
6252
* 11.2.5.6 Destination As statement
6353
* Some string formatting specificiers are not implemented.
6454
* There is no way to use Arden variables within mapping clauses.

build.xml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
Author: Hannes Flicka (hflicka@github)
88
-->
9-
<project name="arden2bytecode" default="jar" basedir=".">
9+
<project name="arden2bytecode" default="compile" basedir=".">
1010
<description>arden2bytecode ant build script</description>
1111

1212
<!-- global properties -->
@@ -56,6 +56,21 @@
5656
<exclude name="hamcrest-core*.jar" />
5757
<exclude name="sqlite-jdbc*.jar" />
5858
</fileset>
59+
60+
61+
<target name="dependencies" description="Download dependencies">
62+
<mkdir dir="${tools.dir}" />
63+
<get dest="${tools.dir}/sablecc.jar" skipexisting="true"
64+
src="http://central.maven.org/maven2/sablecc/sablecc/3.2-1/sablecc-3.2-1.jar" />
65+
66+
<mkdir dir="${lib.dir}" />
67+
<get dest="${lib.dir}" skipexisting="true">
68+
<url url="http://central.maven.org/maven2/com/lexicalscope/jewelcli/jewelcli/0.8.9/jewelcli-0.8.9.jar" />
69+
<url url="http://central.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" />
70+
<url url="http://central.maven.org/maven2/junit/junit/4.12/junit-4.12.jar" />
71+
<url url="http://central.maven.org/maven2/org/xerial/sqlite-jdbc/3.8.11.2/sqlite-jdbc-3.8.11.2.jar" />
72+
</get>
73+
</target>
5974

6075

6176
<target name="clean"
@@ -76,7 +91,7 @@
7691
</target>
7792

7893

79-
<target name="compile" depends="sableCC"
94+
<target name="compile" depends="sableCC, dependencies"
8095
description="Compile sources">
8196
<mkdir dir="${build.dir}" />
8297

@@ -93,13 +108,13 @@
93108
</copy>
94109

95110
<javac srcdir="${src.dir}:${test.dir}" destdir="${build.dir}" debug="${debug}"
96-
classpathref="build.classpath" optimize="${optimize}" source="1.6" includeantruntime="false">
111+
classpathref="build.classpath" optimize="${optimize}" source="1.7" includeantruntime="false">
97112
<include name="**/*.java" />
98113
</javac>
99114
</target>
100115

101116

102-
<target name="sableCC" depends="sableCC.constants, sableCC.compiler"
117+
<target name="sableCC" depends="dependencies, sableCC.constants, sableCC.compiler"
103118
description="Start sableCC to generate parsers from grammars">
104119
</target>
105120

0 commit comments

Comments
 (0)