Results 1 to 4 of 4

Thread: 4GL translator

  1. #1
    Member registered user
    Join Date
    Nov 2004
    Location
    Queretaro Mexico
    Posts
    36

    4GL translator

    Hi, I know this is not completely related to knoppix, but here it goes. Does anyone knows what 4GL is (Fourth generation language)???
    Is there a compiler for linux????
    In one of my classes the professor asked me to make a 4GL to PHP translator but I have no idea what 4GL is and I can't seem to find some clear info ion google, I have found something to do with INFORMIX but nothing is clear to me. If anyone knows anything about it, I'd really apretiate it.

  2. #2
    Senior Member registered user
    Join Date
    Dec 2003
    Location
    Salt Lake City, UT, U.S.A.
    Posts
    1,338
    emmbec,

    Not sure if this will help, but, I had been in the "computer" field during the advent of 4th Generation Languages, and had the opportunity to work on, and with, one of these...

    The product was called Information, and was released through Prime Computers, as a "standard" package that came with there mini-computers and there "propietary" OS -=- PrimeOS.

    The "language" was designed as "english-like", and allowed setenced to describe extraction and listing of "multi-relational", and "free-formed", non-blocked databases... To explain...

    Sample sentences could be of the following:
    List audiofile with price greater than 20.00

    List video with Director matching "Lucas" and with Actor matching "Carrie Fisher"

    What made these databases revolutionary was the way "fields" were maintained. Up to this point, databases were "fielded" by character positions. A "record" was described in how many characters the field had... Like: Title = 80 char, Auther = 25 char, Actor = 25 char, Price = md2 5 char... etc... When someone needed to make a record "field" longer, it required a translation program that read in the "records" in the old format, and wrote out the "new" record format into a new format... Like this: read old record, save out new record with Author now "fielded" into 45 characters, and then all files that dealt with the "file" had to be changed to reflect the new format...

    As in the case of Prime Computers Information databases, they were not fielded by character positions, but, rather, with special "control" characters... A records field was determined by where the "control" character was, and not on a "physical" character position. Thus, a database could have fields of non-same length data, and the complete record, could be of non-same length...

    A sample database would not look like a text file, but a long string of data, i.e. non-blocked, and might look like this:

    George Lucas^253Carrie Fisher^253Star Wars^254George Remero^253I Dont Know the Actors Name^253I think the title was called: "Swamp Thing"...

    Whereas, this same database if examined in a previous "blocked" database, would have looked like this:
    ( with the following assumptions: Director = 25 char, Actor = 25 char, Title = 25 char )
    Code:
    "George Lucas             ""Carrie Fisher            ""Star Wars                "
    "George Romero          ""I Dont Know the Act""I think the title was "
    As you can see, in many cases, a "record" would have "wasted" white-space saved in the record, ( if it didnt use all of the complete field ), and in other situations, the field would not be big enough to contain all the data needed. Prime Information was a 4GL because it allowed a record to be as big as it needed, when the need arrose, but didnt waste space when a record didnt need to be a specific length... Add into this, the "parser" for getting information out of the database was more "english" sentence structured, allowing a person to ask for data output, in a more familiar fashion...

    Another "feature" of Information was adding new fields wasnt like the old way; you had to do the same thing as if you wanted to increase a "fields" length thing, but, rather, in Information, all you had to do was add a new entry into the data descriptor file, or the .doc file, for the data file, and start using the new field. Like, adding "price" to the above database would be as easy as adding "price = md2" to the video.doc file, and the database would now allow you to enter a masked decimal to two decimal places, in the field "price" to any, or all, of the records in the "video" file.

    Data was maintained by the 4GL program, and output was maintained by a display mask; each field could be displayed, for forms, and listing, not the actual data being "constrained" to these "display" characters... output for price, in the above database could be $##, or $#,###, or $#.## - etc... the actual data didnt change, just the way it was being displayed. Data could be left, right, or center alligned in its output, and data could be output with "code" applied. Switches could be "coded", like if 'price' gt '20' then "Expensive" else "Cheap" - where the following would output not the price, but a description of that price... Record "fields" could be appended to each other, with, or without, extra code, like this: Director ;" / "; Actor ;" / "; Title -=- in which case the output from this code would list like this: George Lucas / Carrie Fisher / Star Wars... etc...

    Not sure if any of this is what you have to create a "translator" for, or what your "professor" really wants, but, thats what I have come to understand a 4GL is all about...

    Hope this helps,
    Ms. Cuddles

  3. #3
    Member registered user
    Join Date
    Nov 2004
    Location
    Queretaro Mexico
    Posts
    36
    Thanx, that helped me to get an idea of how this works. Now, I need to know how this grammer would look like, for example:

    FILE: function;
    N : num;
    function : function | e;
    Has anyone done somthing like this?

  4. #4
    Member registered user
    Join Date
    Nov 2004
    Location
    Queretaro Mexico
    Posts
    36
    OK I finally did it, Its a ver long grammar, but in case someone is interested write me at emmbec@gmail.com and I'll send you the rest of the grammar. Its in spanish but is something. It looks like:

    <DB>::= 'DATABASE' 'id' ',' 'id' ',' 'id' ',' 'id' <inicio>

    <inicio> ::= 'GLOBALS' <declaraciones> 'END' 'GLOBALS' <funciones>
    <inicio> ::= <funciones>

    <funciones>::= <funciones> <funcion>
    <funciones>::= <funcion>

    <funcion> ::= 'FUNCTION' 'id' '('<lst_identif>')' <acciones> 'END' 'FUNCTION'
    <funcion> ::= 'FUNCTION' 'id' '(' ')' <acciones> 'END' 'FUNCTION'
    <funcion> ::= 'MAIN' <acciones> 'END' 'MAIN'
    <funcion> ::= 'FUNCTION' 'id' '('<lst_identif>')' <acciones> <sentencias> 'END' 'FUNCTION'
    <funcion> ::= 'FUNCTION' 'id' '(' ')' <acciones> <sentencias> 'END' 'FUNCTION'
    <funcion> ::= 'MAIN' <acciones> <sentencias> 'END' 'MAIN'
    <funcion> ::= <form>
    I parsed it using GOLD PARSER.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Western Digital 1TB WD Blue PC Desktop 3.5'' Internal CMR Hard Drive - WD10EARZ picture

Western Digital 1TB WD Blue PC Desktop 3.5'' Internal CMR Hard Drive - WD10EARZ

$44.99



WD_BLACK 1TB SN850X NVMe SSD, Internal Gaming Solid State Drive - WDS100T2X0E picture

WD_BLACK 1TB SN850X NVMe SSD, Internal Gaming Solid State Drive - WDS100T2X0E

$99.99



Western Digital 1TB WD Blue SA510 SATA SSD Internal 2.5”/7mm Cased - WDS100T3B0A picture

Western Digital 1TB WD Blue SA510 SATA SSD Internal 2.5”/7mm Cased - WDS100T3B0A

$79.99



Western Digital 1TB WD Gold Enterprise Class SATA Internal HDD - WD1005FBYZ picture

Western Digital 1TB WD Gold Enterprise Class SATA Internal HDD - WD1005FBYZ

$84.99



Samsung - 980 PRO 1TB Internal Gaming SSD PCIe Gen 4 x4 NVMe picture

Samsung - 980 PRO 1TB Internal Gaming SSD PCIe Gen 4 x4 NVMe

$109.99



Patriot P210 128GB 256GB 512GB 1TB 2TB 2.5

Patriot P210 128GB 256GB 512GB 1TB 2TB 2.5" SATA 3 6GB/s Internal SSD PC/MAC Lot

$19.99



Samsung - Geek Squad Certified Refurbished 870 EVO 1TB SATA Solid State Drive picture

Samsung - Geek Squad Certified Refurbished 870 EVO 1TB SATA Solid State Drive

$67.99



2 PACK  Seagate ST1000LM035 Mobile HDD 1TB 2.5

2 PACK Seagate ST1000LM035 Mobile HDD 1TB 2.5" SATA III Laptop Hard Drive

$26.89



1TB/2TB USB 3.0 Flash Drive Thumb U Disk Memory Stick Pen PC Laptop Storage lot picture

1TB/2TB USB 3.0 Flash Drive Thumb U Disk Memory Stick Pen PC Laptop Storage lot

$773.19



Netac 1TB 2TB 512GB Internal SSD 2.5'' SATA III 6Gb/s Solid State Drive lot picture

Netac 1TB 2TB 512GB Internal SSD 2.5'' SATA III 6Gb/s Solid State Drive lot

$109.99