diff --git a/.gitignore b/.gitignore
index 4c68c8596d33674a2555a02dee72af3e4fc3ea53..330de856f0d8e62a2eef7bfd8c7f1f6d3522376e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,14 @@
 **/Debug
 **/Release
 
+# aconversions specific targets
+aconversions/afsm2rg
+aconversions/arg2fsm
+aconversions/afsm2re
+aconversions/are2fsm
+aconversions/arg2re
+aconversions/are2rg
+
 # Compiled Object files
 *.slo
 *.lo
diff --git a/aconversions/.cproject b/aconversions/.cproject
new file mode 100644
index 0000000000000000000000000000000000000000..a245ccfbe8525da0f22965f5f091ef4e981590b8
--- /dev/null
+++ b/aconversions/.cproject
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+	<storageModule moduleId="org.eclipse.cdt.core.settings">
+		<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1988565968">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1988565968" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1988565968" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
+					<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1988565968." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.2145322734" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.1690067828" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
+							<builder buildPath="${workspace_loc:/aconversions}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.1724289684" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.archiver.base.2132784162" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.2007935398" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+								<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1420626117" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.750696876" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.option.include.paths.619927979" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/alib/src}&quot;"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1133597878" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1198088489" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
+								<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1504447297" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.exe.debug.option.debugging.level.1247411673" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1189852814" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1610673991" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.422245398" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
+								<option id="gnu.cpp.link.option.libs.1479950460" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+									<listOptionValue builtIn="false" value="alib"/>
+								</option>
+								<option id="gnu.cpp.link.option.paths.1290703739" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/alib/Debug}&quot;"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1692658180" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+								</inputType>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1786933996" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1629599789" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry excluding="afsm2rg|src/rg2fsm|src/fsm2rg" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="cdt.managedbuild.config.gnu.exe.release.431501956">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.431501956" moduleId="org.eclipse.cdt.core.settings" name="Release">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.431501956" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
+					<folderInfo id="cdt.managedbuild.config.gnu.exe.release.431501956." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.919970955" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1387889808" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
+							<builder buildPath="${workspace_loc:/aconversions}/Release" id="cdt.managedbuild.target.gnu.builder.exe.release.1020487954" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
+							<tool id="cdt.managedbuild.tool.gnu.archiver.base.178390178" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.847661583" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
+								<option id="gnu.cpp.compiler.exe.release.option.optimization.level.243193135" name="Optimization Level" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.exe.release.option.debugging.level.1228127187" name="Debug Level" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1839212147" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.489752447" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
+								<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.525463206" name="Optimization Level" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.exe.release.option.debugging.level.1207405604" name="Debug Level" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1884817039" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.1049049603" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.44073728" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release">
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1447635553" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+								</inputType>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.1713687409" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.930343315" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry excluding="afsm2rg|src/rg2fsm|src/fsm2rg" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1988565968.2077734878">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1988565968.2077734878" moduleId="org.eclipse.cdt.core.settings" name="afsm2rg">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1988565968.2077734878" name="afsm2rg" parent="cdt.managedbuild.config.gnu.exe.debug">
+					<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1988565968.2077734878." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1163399431" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.12097740" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
+							<builder buildPath="${workspace_loc:/aconversions}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.774430906" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.archiver.base.2000533032" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.689439375" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+								<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.952777165" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.1254947323" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.option.include.paths.1602573819" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/alib/src}&quot;"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1393816980" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1999103319" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
+								<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1962342513" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.exe.debug.option.debugging.level.765039437" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1722777615" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.797807830" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.270290307" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
+								<option id="gnu.cpp.link.option.libs.1892985059" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+									<listOptionValue builtIn="false" value="alib"/>
+								</option>
+								<option id="gnu.cpp.link.option.paths.1243381605" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/alib/Debug}&quot;"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1089719470" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+								</inputType>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1948392650" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.603842698" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry excluding="src/rg2fsm" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+		<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.1988565968.1955017273">
+			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.1988565968.1955017273" moduleId="org.eclipse.cdt.core.settings" name="arg2fsm">
+				<externalSettings/>
+				<extensions>
+					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+				</extensions>
+			</storageModule>
+			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+				<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.1988565968.1955017273" name="arg2fsm" parent="cdt.managedbuild.config.gnu.exe.debug">
+					<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.1988565968.1955017273." name="/" resourcePath="">
+						<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.30966406" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+							<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.375369379" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
+							<builder buildPath="${workspace_loc:/aconversions}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.1236307034" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.archiver.base.924812237" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.875390371" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+								<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1255147689" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.515240613" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+								<option id="gnu.cpp.compiler.option.include.paths.45908198" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/alib/src}&quot;"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1881047541" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1618627351" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
+								<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1357909590" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
+								<option id="gnu.c.compiler.exe.debug.option.debugging.level.117170283" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.889163642" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.999062614" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
+							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.556165410" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
+								<option id="gnu.cpp.link.option.libs.1563918087" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+									<listOptionValue builtIn="false" value="alib"/>
+								</option>
+								<option id="gnu.cpp.link.option.paths.323568976" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/alib/Debug}&quot;"/>
+								</option>
+								<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1287333492" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
+								</inputType>
+							</tool>
+							<tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.2048027174" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
+								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1925037264" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+							</tool>
+						</toolChain>
+					</folderInfo>
+					<sourceEntries>
+						<entry excluding="src/fsm2rg|afsm2rg" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
+					</sourceEntries>
+				</configuration>
+			</storageModule>
+			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+		</cconfiguration>
+	</storageModule>
+	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
+		<project id="aconversions.cdt.managedbuild.target.gnu.exe.518781615" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+	</storageModule>
+	<storageModule moduleId="scannerConfiguration">
+		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.431501956;cdt.managedbuild.config.gnu.exe.release.431501956.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.847661583;cdt.managedbuild.tool.gnu.cpp.compiler.input.1839212147">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1988565968;cdt.managedbuild.config.gnu.exe.debug.1988565968.;cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.2007935398;cdt.managedbuild.tool.gnu.cpp.compiler.input.1133597878">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.431501956;cdt.managedbuild.config.gnu.exe.release.431501956.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.489752447;cdt.managedbuild.tool.gnu.c.compiler.input.1884817039">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.1988565968;cdt.managedbuild.config.gnu.exe.debug.1988565968.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1198088489;cdt.managedbuild.tool.gnu.c.compiler.input.1189852814">
+			<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+		</scannerConfigBuildInfo>
+	</storageModule>
+	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+	<storageModule moduleId="refreshScope" versionNumber="2">
+		<configuration configurationName="Release">
+			<resource resourceType="PROJECT" workspacePath="/aconversions"/>
+		</configuration>
+		<configuration configurationName="afsm2rg">
+			<resource resourceType="PROJECT" workspacePath="/aconversions"/>
+		</configuration>
+		<configuration configurationName="Debug">
+			<resource resourceType="PROJECT" workspacePath="/aconversions"/>
+		</configuration>
+	</storageModule>
+</cproject>
diff --git a/aconversions/.project b/aconversions/.project
new file mode 100644
index 0000000000000000000000000000000000000000..7754070d5c2a2eb724b4a62290c4a21c344b52a3
--- /dev/null
+++ b/aconversions/.project
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>aconversions</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+			<triggers>clean,full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.cdt.core.cnature</nature>
+		<nature>org.eclipse.cdt.core.ccnature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+		<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+	</natures>
+</projectDescription>
diff --git a/aconversions/src/fsm2rg/FSM2RGConvert.cpp b/aconversions/src/fsm2rg/FSM2RGConvert.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..33c93d5021e2ab5f58e0d94efb2cc2e24a80e967
--- /dev/null
+++ b/aconversions/src/fsm2rg/FSM2RGConvert.cpp
@@ -0,0 +1,145 @@
+/*
+ * FSM2RGConvert.cpp
+ *
+ *  Created on: 10. 11. 2013
+ *      Author: tomas
+ */
+
+#include <algorithm>
+#include "FSM2RGConvert.h"
+
+#include <iostream>
+#include <cassert>
+
+/*
+ * implements algorithm 2.104 in "Melichar, B. Jazyky a překlady. Praha, Vydavatelství ČVUT 2007."
+ * Input: NFA M = (Q, T, \delta, q_0, F)
+ * Output: Right regular grammar G=(N,T,P,S), L(M)=L(G)
+ */
+
+// Check whether the nonterminal is on right side of any rule.
+bool FSM2RGConvert::isNonterminalOnRightSide( const set<Rule> & rules, const Symbol & nonterminal )
+{
+    for( set<Rule>::const_iterator i = rules.begin(); i!= rules.end(); i++ )
+    {
+        list<Symbol> leftSide = i -> getLeftSide();
+
+        list<Symbol>::const_iterator onRightSide = find( leftSide.begin(), leftSide.end(), nonterminal );
+        if ( onRightSide != leftSide.end() )
+            return true;
+    }
+
+    return false;
+}
+
+
+const Symbol& FSM2RGConvert::getSymbol( const set<Symbol> & symbolSet, const string& symbol )
+{
+    for( set<Symbol>::const_iterator i = symbolSet.begin(); i != symbolSet.end(); i++ )
+    {
+        if ( i->getSymbol() == symbol )
+            return *i;
+    }
+
+    assert(false);
+    return *symbolSet.begin();
+}
+
+
+RightRegularGrammar * FSM2RGConvert::convert( FSM* automaton )
+{
+    RightRegularGrammar* regularGrammar = new RightRegularGrammar();
+
+    // step 1 - init T and N in G
+    for( set<Symbol>::const_iterator i = automaton -> getInputAlphabet().begin(); i != automaton -> getInputAlphabet().end(); i++ )
+        regularGrammar -> addTerminalSymbol( *i );
+
+    for( set<State>::const_iterator i = automaton -> getStates().begin(); i != automaton -> getStates().end(); i++)
+         regularGrammar -> addNonTerminalSymbol( Symbol( i->getName() ) );
+
+
+    // step 2 - create set of P in G
+    const set<Symbol>& nonTerminals = regularGrammar -> getNonTerminalSymbols();
+    const set<Symbol>& terminals = regularGrammar -> getTerminalSymbols();
+
+    for( set<TransitionFSM>::const_iterator i = automaton -> getTransitions().begin(); i != automaton -> getTransitions().end(); i++ )
+    {
+        Rule r;
+        list<Symbol> leftSide, rightSide;
+
+        // 2a
+        leftSide.push_back( getSymbol ( nonTerminals, i->getFrom().getName() ));
+        rightSide.push_back( getSymbol ( terminals,    i->getInput().getSymbol() ));
+        rightSide.push_back( getSymbol ( nonTerminals, i->getTo().getName() ));
+
+        r . setLeftSide( leftSide );
+        r . setRightSide( rightSide );
+        regularGrammar -> addRule(r);
+
+        // 2b
+        if ( automaton -> getFinalStates() . find( i-> getTo()) != automaton->getFinalStates().end() )
+        {
+            Rule r;
+            list<Symbol> leftSide, rightSide;
+
+            leftSide.push_back( getSymbol( nonTerminals, i->getFrom().getName() ));
+            rightSide.push_back( getSymbol( terminals, i->getInput().getSymbol() ));
+            r.setLeftSide( leftSide );
+            r.setRightSide( rightSide );
+
+            regularGrammar -> addRule(r);
+        }
+    }
+
+    // step 3 - Set S in G
+    assert( automaton->getInitialStates().size() == 1 ); // TODO: What if... FSM has more than 1 initial state?
+    regularGrammar-> setStartSymbol( Symbol( automaton->getInitialStates().begin() -> getName() ));
+
+    // step 4
+    if ( automaton->getFinalStates() . find( State(regularGrammar -> getStartSymbol().getSymbol())) != automaton->getFinalStates().end() )
+    {
+        regularGrammar -> addTerminalSymbol( Symbol( "" ));
+        // 4a
+        if ( ! isNonterminalOnRightSide( regularGrammar -> getRules(), regularGrammar -> getStartSymbol() ) )
+        {
+            Rule r;
+            list<Symbol> leftSide, rightSide;
+
+            leftSide.push_back( regularGrammar -> getStartSymbol() );
+            rightSide.push_back( Symbol( "" ) );
+
+            regularGrammar -> addRule(r);
+        }
+        else // 4b
+        {
+            Symbol newStart(regularGrammar->getStartSymbol().getSymbol() + "'"); //TODO: unique name
+            regularGrammar -> addNonTerminalSymbol( newStart );
+
+            for( set<Rule>::const_iterator i = regularGrammar->getRules().begin(); i != regularGrammar->getRules().end(); i++ )
+            {
+                if( *(i->getLeftSide().begin()) == regularGrammar->getStartSymbol())
+                {
+                    Rule r;
+                    list<Symbol> leftSide, rightSide( i->getRightSide() );
+                    leftSide.push_back( newStart );
+
+                    r.setLeftSide( leftSide );
+                    r.setRightSide( rightSide );
+                    regularGrammar -> addRule(r);
+                }
+            }
+            regularGrammar -> setStartSymbol( newStart );
+
+            Rule rr;
+            list<Symbol> leftSide, rightSide;
+            leftSide.push_back( newStart );
+            rightSide.push_back( Symbol( "" ) );
+            rr.setLeftSide( leftSide );
+            rr.setRightSide( rightSide );
+
+            regularGrammar-> addRule(rr);
+        }
+    }
+
+    return regularGrammar;
+}
diff --git a/aconversions/src/fsm2rg/FSM2RGConvert.h b/aconversions/src/fsm2rg/FSM2RGConvert.h
new file mode 100644
index 0000000000000000000000000000000000000000..7307b8c5d50d4c2fc37d3444844dd5ca685ff710
--- /dev/null
+++ b/aconversions/src/fsm2rg/FSM2RGConvert.h
@@ -0,0 +1,30 @@
+/*
+ * FSM2RGConvert.h
+ *
+ *  Created on: 10. 11. 2013
+ *      Author: Tomas Pecka
+ */
+
+//FIXME Find better name than fsm2rg !
+
+#ifndef FSM2RGCONVERT_H_
+#define FSM2RGCONVERT_H_
+
+#include "automaton/FSM/FSM.h"
+#include "grammar/RightRegularGrammar.h"
+
+using namespace std;
+using namespace automaton;
+using namespace grammar;
+
+class FSM2RGConvert
+{
+public:
+    static RightRegularGrammar* convert( FSM* automaton );
+
+protected:
+    static bool isNonterminalOnRightSide( const set<Rule> & rules, const Symbol & nonterminal );
+    static const Symbol& getSymbol( const set<Symbol> & symbolSet, const string& symbol );
+};
+
+#endif /* FSM2RGCONVERT_H_ */
diff --git a/aconversions/src/fsm2rg/afsm2rg.cpp b/aconversions/src/fsm2rg/afsm2rg.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..37af23c730692078d99bc974526d9b16d927a395
--- /dev/null
+++ b/aconversions/src/fsm2rg/afsm2rg.cpp
@@ -0,0 +1,54 @@
+//============================================================================
+// Name        : afsm2rg.cpp
+// Author      : Tomas Pecka
+// Version     :
+// Copyright   :
+// Description :
+//============================================================================
+
+#include <iostream>
+
+#include "automaton/UnknownAutomaton.h"
+#include "AutomatonFactory.h"
+#include "AlibException.h"
+
+#include "FSM2RGConvert.h"
+#include "grammar/GrammarPrinter.h"
+
+using namespace std;
+using namespace automaton;
+using namespace alib;
+
+int main(int argc, char** argv)
+{
+    UnknownAutomaton automaton;
+
+    try
+    {
+        if (argc > 1)
+        {
+            if (string("-h").compare(argv[1]) == 0)
+            {
+                cout << "Converts FSM to right regular grammar." << endl;
+                cout << "Usage: afsm2rg [automaton.xml]" << endl;
+                return -1;
+            }
+
+            automaton = AutomatonFactory::fromFile(argv[1]);
+        }
+        else
+        {
+            string input(istreambuf_iterator<char>(cin), (istreambuf_iterator<char>()));
+            automaton = AutomatonFactory::fromString(input);
+        }
+
+        Automaton* knownAutomaton = AutomatonFactory::buildAutomaton(&automaton);
+        Grammar* rg = FSM2RGConvert::convert( dynamic_cast<FSM*>(knownAutomaton) );
+        GrammarPrinter::toXML(*rg, cout);
+    }
+    catch (AlibException& e)
+    {
+        cout << e.what() << endl;
+        return 0;
+    }
+}
diff --git a/aconversions/src/rg2fsm/RG2FSMConvert.cpp b/aconversions/src/rg2fsm/RG2FSMConvert.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7b10ecbc350d4edb9b15b3c9f1a071688a6f23d0
--- /dev/null
+++ b/aconversions/src/rg2fsm/RG2FSMConvert.cpp
@@ -0,0 +1,86 @@
+/*
+ * FSM2RGConvert.cpp
+ *
+ *  Created on: 10. 11. 2013
+ *      Author: tomas
+ */
+
+#include <algorithm>
+#include "RG2FSMConvert.h"
+
+#include <iostream>
+#include <cassert>
+
+/*
+ * implements 2.98 in "[2] Melichar, B. Jazyky a překlady. Praha, Vydavatelství ČVUT 2007."
+ * Input: Right regular grammar G=(N,T,P,S)
+ * Output: NFA M = (Q, T, \delta, q_0, F) , L(M)=L(G)
+ */
+
+// Check whether the nonterminal is on right side of any rule.
+const Symbol& RG2FSMConvert::getSymbol( const set<Symbol> & symbolSet, const string& symbol )
+{
+    for( set<Symbol>::const_iterator i = symbolSet.begin(); i != symbolSet.end(); i++ )
+    {
+        if ( i->getSymbol() == symbol )
+            return *i;
+    }
+
+    assert(false);
+    return *symbolSet.begin();
+}
+
+
+FSM * RG2FSMConvert::convert( RightRegularGrammar* grammar )
+{
+    FSM* automaton = new FSM();
+
+    // step 1
+    for( set<Symbol>::const_iterator i = grammar -> getTerminalSymbols().begin(); i != grammar -> getTerminalSymbols().end(); i++ )
+        automaton -> addInputSymbol( *i );
+
+    // step 2
+    for( set<Symbol>::const_iterator i = grammar -> getNonTerminalSymbols().begin(); i != grammar -> getNonTerminalSymbols().end(); i++ )
+        automaton -> addState( State( i->getSymbol() ) );
+
+    State AState( "o____o" ); // TODO: unique name
+    automaton -> addState( AState );
+
+    // step 3, constructing \delta
+    for( set<Rule>::const_iterator i = grammar -> getRules().begin(); i != grammar -> getRules().end(); i++ )
+    {
+        State current( i->getLeftSide().begin()->getSymbol() );
+        Symbol input( i->getRightSide().begin()->getSymbol() );
+
+        // if B->a => \delta(B,a)=AState
+        if( i->getRightSide().size() == 1 )
+            automaton->addTransition( current, input, AState );
+
+        // if B->aC => \delta(B,a)=C
+        if( i->getRightSide().size() == 2 )
+        {
+            list<Symbol>::const_iterator it = i->getRightSide().begin();
+            it ++;
+            State next( it->getSymbol() );
+            automaton->addTransition( current, input, next );
+        }
+
+    }
+
+    // step 4
+    automaton -> addInitialState( State( grammar->getStartSymbol().getSymbol()) );
+
+    // step 5
+    automaton -> addFinalState( AState );
+    for( set<Rule>::const_iterator i = grammar->getRules().begin(); i != grammar->getRules().end(); i++ )
+    {
+        // if S->\epsilon
+        if( i->getLeftSide().size() == 1 && *( i->getLeftSide().begin() ) == grammar->getStartSymbol() &&
+            i->getRightSide().size() == 1 && *( i->getRightSide().begin()) == Symbol("") )
+        {
+            automaton -> addFinalState( State( grammar->getStartSymbol().getSymbol() ));
+        }
+    }
+
+    return automaton;
+}
diff --git a/aconversions/src/rg2fsm/RG2FSMConvert.h b/aconversions/src/rg2fsm/RG2FSMConvert.h
new file mode 100644
index 0000000000000000000000000000000000000000..0e11ce44ce017479e565712608e461ed86e30665
--- /dev/null
+++ b/aconversions/src/rg2fsm/RG2FSMConvert.h
@@ -0,0 +1,27 @@
+/*
+ * RG2FSMConvert.h
+ *
+ *  Created on: 10. 11. 2013
+ *      Author: Tomas Pecka
+ */
+
+#ifndef RG2FSMCONVERT_H_
+#define RG2FSMCONVERT_H_
+
+#include "automaton/FSM/FSM.h"
+#include "grammar/RightRegularGrammar.h"
+
+using namespace std;
+using namespace automaton;
+using namespace grammar;
+
+class RG2FSMConvert
+{
+public:
+    static FSM* convert( RightRegularGrammar* grammar );
+
+protected:
+    static const Symbol& getSymbol( const set<Symbol> & symbolSet, const string& symbol );
+};
+
+#endif /* RG2FSMCONVERT_H_ */
diff --git a/aconversions/src/rg2fsm/arg2fsm.cpp b/aconversions/src/rg2fsm/arg2fsm.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..48bec1d7475dd98188a146eb6e97100bbcb03f03
--- /dev/null
+++ b/aconversions/src/rg2fsm/arg2fsm.cpp
@@ -0,0 +1,56 @@
+//============================================================================
+// Name        : afsm2rg.cpp
+// Author      : Tomas Pecka
+// Version     :
+// Copyright   :
+// Description :
+//============================================================================
+
+#include <iostream>
+
+#include "grammar/UnknownGrammar.h"
+#include "GrammarFactory.h"
+#include "AlibException.h"
+
+#include "automaton/AutomatonPrinter.h"
+
+#include "RG2FSMConvert.h"
+
+using namespace std;
+using namespace grammar;
+using namespace automaton;
+using namespace alib;
+
+int main(int argc, char** argv)
+{
+    UnknownGrammar grammar;
+
+    try
+    {
+        if (argc > 1)
+        {
+            if (string("-h").compare(argv[1]) == 0)
+            {
+                cout << "Converts right regular grammar to nfsm." << endl;
+                cout << "Usage: arg2fsm [grammar.xml]" << endl;
+                return -1;
+            }
+
+            grammar = GrammarFactory::fromFile(argv[1]);
+        }
+        else
+        {
+            string input(istreambuf_iterator<char>(cin), (istreambuf_iterator<char>()));
+            grammar = GrammarFactory::fromString(input);
+        }
+
+        RightRegularGrammar knownGrammar = GrammarFactory::buildRightRegularGrammar(&grammar);
+        FSM* fsm = RG2FSMConvert::convert( & knownGrammar );
+        AutomatonPrinter::toXML(*fsm, cout);
+    }
+    catch (AlibException& e)
+    {
+        cout << e.what() << endl;
+        return 0;
+    }
+}