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
  •  


A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$13.99



Samsung 16GB 2Rx4 PC4-2133P DDR4-17000 1.2V RDIMM ECC Registered Server Memory picture

Samsung 16GB 2Rx4 PC4-2133P DDR4-17000 1.2V RDIMM ECC Registered Server Memory

$16.29



HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin picture

HyperX FURY DDR3 8GB 16GB 32GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pin

$12.90



Samsung  8 GB PC4-17000 DDR4-2133 1Rx8 DDR4 Desktop Memory HP P/N  798034-001 picture

Samsung 8 GB PC4-17000 DDR4-2133 1Rx8 DDR4 Desktop Memory HP P/N 798034-001

$10.00



A-Tech 16GB 2 x 8GB PC3-12800 Laptop SODIMM DDR3 1600 Memory RAM PC3L 16G DDR3L picture

A-Tech 16GB 2 x 8GB PC3-12800 Laptop SODIMM DDR3 1600 Memory RAM PC3L 16G DDR3L

$27.98



A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G picture

A-Tech 8GB PC3-12800 Desktop DDR3 1600 MHz Non ECC 240-Pin DIMM Memory RAM 1x 8G

$13.99



Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM picture

Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM

$13.25



32GB (4X8GB) DDR3 PC3-12800 1600 NON ECC LOW DENSITY MEMORY F3-12800CL10Q-32GBXL picture

32GB (4X8GB) DDR3 PC3-12800 1600 NON ECC LOW DENSITY MEMORY F3-12800CL10Q-32GBXL

$32.00



A-Tech 256GB 4x 64GB 4Rx4 PC4-19200 ECC Load Reduced LRDIMM Server Memory RAM picture

A-Tech 256GB 4x 64GB 4Rx4 PC4-19200 ECC Load Reduced LRDIMM Server Memory RAM

$287.96



A-Tech 64GB 4x 16GB 2Rx4 PC4-17000R DDR4 2133MHz ECC REG RDIMM Server Memory RAM picture

A-Tech 64GB 4x 16GB 2Rx4 PC4-17000R DDR4 2133MHz ECC REG RDIMM Server Memory RAM

$87.96