Results 1 to 4 of 4

Thread: 4GL translator

Hybrid View

  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 [email protected] 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
  •  


🔀 Juniper Networks EX2300-C-12P 12× Gigabit PoE+ • 2× 10G SFP+ Compact Switch ⚡ picture

🔀 Juniper Networks EX2300-C-12P 12× Gigabit PoE+ • 2× 10G SFP+ Compact Switch ⚡

$109.99



Juniper EX2300 12-Port Gigabit PoE+ Managed Network Switch P/N: EX2300-C-12P picture

Juniper EX2300 12-Port Gigabit PoE+ Managed Network Switch P/N: EX2300-C-12P

$149.99



Juniper EX3400-24P 24-Port PoE+ GbE + 4-Port 1/10Gb SFP Switch picture

Juniper EX3400-24P 24-Port PoE+ GbE + 4-Port 1/10Gb SFP Switch

$245.00



Juniper Networks Mist Wireless Access Points, Model AP45 picture

Juniper Networks Mist Wireless Access Points, Model AP45

$59.99



Juniper MX204 +JUNOS and Dual Power Supply picture

Juniper MX204 +JUNOS and Dual Power Supply

$7299.99



Juniper Networks MX204-HW-BASE *BRAND NEW FACTORY SEALED* READ DETAILS picture

Juniper Networks MX204-HW-BASE *BRAND NEW FACTORY SEALED* READ DETAILS

$8199.99



Juniper QFX5120-48Y-AFO 48 x 1/10/25GB SFP28 + 8 x 40/100GB Switch w/Dual AC picture

Juniper QFX5120-48Y-AFO 48 x 1/10/25GB SFP28 + 8 x 40/100GB Switch w/Dual AC

$10499.99



Juniper EX2300-C 12 Port Compact Gigabit Switch EX2300-C-12p Discounted Cosmetic picture

Juniper EX2300-C 12 Port Compact Gigabit Switch EX2300-C-12p Discounted Cosmetic

$79.86



Juniper Networks EX3400-24T 24-Port Ethernet Switch w/Power Cord picture

Juniper Networks EX3400-24T 24-Port Ethernet Switch w/Power Cord

$174.99



Juniper EX4300-24P 24 Port Gigabit PoE+ Switch. picture

Juniper EX4300-24P 24 Port Gigabit PoE+ Switch.

$95.55