Acing Eiffel Configuration files

by Finnian Reilly (modified: 2022 Jul 05)

Background

Back in the early days of Eiffel, coders used to hand edit their system configuration files using a specially designed language called ACE.

Sadly this has been replaced with XML configuration files which seem to be purposely designed to discourage you from hand editing them.

But now there is a tool to parse a configuration file with a very terse syntax that is very readable and has gedit syntax highlighting support. The syntax removes a lot of the needless repetition found in the XML form. I think you will agree the resulting language is "as good as" if not better than ACE.

Gedit Integration

The conversion tool can easily be integrated with gedit using the external tools option and assigned a shortcut key. The conversion is almost instanteous.

Because the Windows version of gedit does not support the external tool options, I have also integrated it with the file context menu on Windows platforms. Presented here are examples of the Pyxis form paired with the resulting XML expansion.

System Specification

XML Expansion

<system xmlns = "http://www.eiffel.com/developers/xml/configuration-1-16-0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation = "http://www.eiffel.com/developers/xml/configuration-1-16-0 http://www.eiffel.com/developers/xml/configuration-1-16-0.xsd" name = "el_eiffel" uuid = "EEA36E90-5A49-11E7-8290-A34D58BF65CD">

Target Settings

XML Expansion

<setting name = "address_expression" value = "false"/> <setting name = "array_optimization" value = "false"/> <setting name = "check_vape" value = "true"/> <setting name = "console_application" value = "true"/> <setting name = "concurrency" value = "thread"/> <setting name = "dead_code_removal" value = "true"/> <setting name = "dynamic_runtime" value = "false"/> <setting name = "exception_trace" value = "false"/> <setting name = "inlining" value = "true"/> <setting name = "inlining_size" value = "3"/> <setting name = "line_generation" value = "false"/>

Compact Name/Value Pairs

Works with both name/value pairs and name/location pairs.

XML Expansion

<precompile name = "precompile" location = "$ISE_PRECOMP/EL/console-application.ecf"/> <variable name = "eapml_limb_type" value = "natural_32"/>

Compact Platform Condition

XML Expansion

<library name = "EL_wel_regedit" location = "wel-regedit-x.ecf"> <condition> <platform value = "windows"/> </condition> </library>

Compact Compiler Options

XML Expansion

<option syntax = "standard" full_class_checking = "false" void_safety = "none" trace = "false" debug = "false" warning = "true"> <assertions precondition = "true" postcondition = "true" check = "true" invariant = "false"/> <debug name = "__unnamed_debug__" enabled = "false"/> <debug name = "dlg_dispatcher" enabled = "false"/> <debug name = "refactor_fixme" enabled = "false"/> <debug name = "vision2_windows" enabled = "false"/> <debug name = "vision2_windows_gdi" enabled = "false"/> <debug name = "wel" enabled = "false"/> <debug name = "wel_gdi_count" enabled = "false"/> <debug name = "wel_gdi_references" enabled = "false"/> <debug name = "text_rectangle" enabled = "false"/> <debug name = "win_dispatcher" enabled = "false"/> <warning name = "obsolete_feature" enabled = "false"/> <warning name = "export_class_missing" enabled = "false"/> <warning name = "old_verbatim_strings" enabled = "false"/> <warning name = "syntax" enabled = "false"/> <warning name = "vjrv" enabled = "false"/> </option>

Library Group with Common Location

The common location is optional.

XML Expansion

<!--ISE libraries--> <library name = "base" location = "$ISE_LIBRARY/library/base/base.ecf"/> <library name = "base_ext" location = "$ISE_LIBRARY/library/base_extension/base_extension.ecf"/> <library name = "time" location = "$ISE_LIBRARY/library/time/time.ecf"/> <library name = "testing" location = "$ISE_LIBRARY/library/testing/testing.ecf"/> <variable name = "eapml_limb_type" value = "natural_32"/> <library name = "integer_x" location = "$ISE_LIBRARY/contrib/library/math/eapml/eapml.ecf"/>

Writeable Library Group with Common Location

Group of libraries with optional common location and with readonly attribute set to false

XML Expansion

<!--Eiffel-Loop--> <library name = "EL_base" location = "$EIFFEL_LOOP/library/base/base.ecf" readonly = "false"/> <library name = "EL_app_manage" location = "$EIFFEL_LOOP/library/app-manage.ecf" readonly = "false"/> <library name = "EL_doc_scan" location = "$EIFFEL_LOOP/library/document-scan.ecf" readonly = "false"/> <library name = "EL_encryption" location = "$EIFFEL_LOOP/library/encryption.ecf" readonly = "false"/> <library name = "EL_evolicity" location = "$EIFFEL_LOOP/library/evolicity.ecf" readonly = "false"/> <library name = "EL_logging" location = "$EIFFEL_LOOP/library/logging.ecf" readonly = "false"/> <library name = "EL_network" location = "$EIFFEL_LOOP/library/network.ecf" readonly = "false"/> <library name = "EL_os_command" location = "$EIFFEL_LOOP/library/os-command.ecf" readonly = "false"/> <library name = "EL_pyxis_scan" location = "$EIFFEL_LOOP/library/pyxis-scan.ecf" readonly = "false"/> <library name = "EL_text_formats" location = "$EIFFEL_LOOP/library/text-formats.ecf" readonly = "false"/> <library name = "EL_text_process" location = "$EIFFEL_LOOP/library/text-process.ecf" readonly = "false"/> <library name = "EL_testing" location = "$EIFFEL_LOOP/library/testing.ecf" readonly = "false"/> <library name = "EL_thread" location = "$EIFFEL_LOOP/library/thread.ecf" readonly = "false"/> <library name = "EL_vtd_xml" location = "$EIFFEL_LOOP/library/vtd-xml.ecf" readonly = "false"/> <library name = "EL_xml_scan" location = "$EIFFEL_LOOP/library/xml-scan.ecf" readonly = "false"/>

Cluster with Platform Filter

XML Expansion

<!--Source code--> <cluster name = "Java" location = "language_interface/Java" recursive = "true"> <file_rule> <exclude>/imp_mswin$</exclude> <condition> <platform value = "unix"/> </condition> </file_rule> <file_rule> <exclude>/imp_unix$</exclude> <condition> <platform value = "windows"/> </condition> </file_rule> </cluster>

Cluster Trees and Sub-Clusters

What is a recursive cluster but a cluster_tree.

Named sub-clusters but without the difficult to remember $|<name> syntax.

XML Expansion

<cluster name = "test" location = "source/test" recursive = "true"> <description> Eiffel Utility Tests Test sets for Eiffel utitlities </description> </cluster> <cluster name = "Test_common" location = "$EIFFEL_LOOP/test/source/common"> <cluster name = "ftp" location = "$|ftp"/> <cluster name = "support" location = "$|support"/> </cluster>