[eiffel-users] Name space configuration shorthand for Pyxis ECF's

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[eiffel-users] Name space configuration shorthand for Pyxis ECF's

Finnian Reilly

Name space configuration shorthand for Pyxis ECF's

Introducing a notational convenience for hand written Eiffel configuration files.


For those that prefer to edit their Eiffel configurations by hand, using the Python inspired Pyxis format is a better alternative to XML. Not only is it more readable, is saves a lot of unnecessary typing. I have explained  in detail the principles of Pyxis in this previous article.

As well as recapping the advantages of Pyxis for hand editing configuration files, I would like to introduce a new notational convenience provided in the tool option el_toolkit -pyxis_to_xml for converting Pyxis to XML. The new feature applies only to files with extension pecf (for Pyxis ECF) and reduces the very long winded xmlns and schema configuration attributes with a single element attribute `configuration_ns'. The value of this attribute is the only piece of information that changes over time, namely the schema version number.


A recap of Pyxis ECF advantages

  • Pyxis is an exact analog of XML
  • More compact and easier to read than XML
  • Syntax highlighting support in Gedit with recognition of full set of ECF keywords. Gedit is available on both Windows and Linux.
  • Any attribute value that is either a number or identifier does not require quote marks. This makes the text look much cleaner.
  • Allows you to repeat element text in quotes without having to repeat the element name. Useful if you have a long list of file exclusions.
  • Easier to insert comments (Precede with '#' sign)

Pyxis as a general Configuration language

Because Pyxis is an analog of XML the same benefits in editing ECF files also apply to any application configuration. Eiffel-Loop has classes to process Pyxis data in the same manner as XML and there are numerous examples.


PECF to ECF conversion tool

You can download the conversion tool el_toolkit from the latest Eiffel-Loop release directory

The Windows exe was tested on Windows 7. The Linux binary is for Linux Mint 17.1 and is compatible with ubuntu 14.04.

On Linux you can integrate the tool with gedit by adding the following external tool script and assign it a shortcut.


#!/bin/sh
el_toolkit -xml_to_pyxis -in "$GEDIT_CURRENT_DOCUMENT_PATH" -no_highlighting


On Windows there is a way to integrate with the file right context menu in file explorer. The Eiffel-Loop setup batch script is able to do it but needs updating for the latest version of gedit.


Gedit syntax highlighting support

To add Gedit syntax highlighting support download this file for Pyxis ECF highlighting.

https://github.com/finnianr/Eiffel-Loop/blob/master/tool/toolkit/language-specs/pecf.lang

(There is also the file pyxis.lang for general purpose Pyxis)


For Linux put here

/home/<user name>/.local/share/gtksourceview-3.0/language-specs

(You might need to change this to gtksourceview-2.0 for earlier versions of gedit)

For Windows put here

C:/Users/<user name>/Local Settings/gtksourceview-3.0/language-specs

-- 
SmartDevelopersUseUnderScoresInTheirIdentifiersBecause_it_is_much_easier_to_read

--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/eiffel-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[eiffel-users] Re: Name space configuration shorthand for Pyxis ECF's

Finnian Reilly

I forgot to add a screenshot


--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/eiffel-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[eiffel-users] Re: Name space configuration shorthand for Pyxis ECF's

Finnian Reilly
In reply to this post by Finnian Reilly
LACE files
New comers to Eiffel may not know this, but when Eiffel first appeared as a language in the 1980's it used a project configuration language called LACE, short for Language for the Assembly of Classes in Eiffel. Here is an example. If you squint your eyes it looks very like the Pyxis format.

system
   
"rich_text"

root
    VISION2_APPLICATION
(root_cluster): "make_and_launch"

default
    assertion
(require)
    assertion
(ensure)
    assertion
(check)
    multithreaded
(no)
    console_application
(no)
    dynamic_runtime
(no)
    dead_code_removal
(yes)
    profile
(no)
    line_generation
(no)
    debug  
(no)
    array_optimization
(no)
    inlining
(no)
    inlining_size
("4")

cluster
       
-- The application
    all root_cluster
: "."

       
-- EiffelBase
    all
base: "$ISE_EIFFEL/library/base"
        exclude
           
"table_eiffel3"; "desc"
       
end

       
-- EiffelVision2
    all vision2
: "$ISE_EIFFEL/library/vision2"

external
    include_path
:
           
"\$(ISE_EIFFEL)/library/event/Clib",
           
"\$(ISE_EIFFEL)/library/vision2/spec/include",
           
"\$(ISE_EIFFEL)/library/vision2/implementation/gtk/Clib `$ISE_EIFFEL/library/vision2/implementation/gtk/Clib/vision2-gtk-config --include_path`"
   
object:
           
"`$(ISE_EIFFEL)/library/vision2/implementation/gtk/Clib/vision2-gtk-config --object`"
end


--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
Visit this group at https://groups.google.com/group/eiffel-users.
For more options, visit https://groups.google.com/d/optout.
Loading...