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
  •  


2023 Apple Macbook Pro 14

2023 Apple Macbook Pro 14" with 16GB RAM, M3, and 512GB SSD Model #: MTL73LL/A

$1550.00



ALLEGIANCE Desktop Computer Gaming PC: Intel 8 Core 128GB RAM, 2TB SSD, GeForce picture

ALLEGIANCE Desktop Computer Gaming PC: Intel 8 Core 128GB RAM, 2TB SSD, GeForce

$687.99



FAST Dell TOUCHSCREEN 8th Gen Intel Quad Core 16GB RAM Pick SSD Wi-Fi BT Win11 picture

FAST Dell TOUCHSCREEN 8th Gen Intel Quad Core 16GB RAM Pick SSD Wi-Fi BT Win11

$199.00



HP Engage Flex PRO Desktop PC Intel Core i5-8500 Intel UHD 8GB DDR4 512GB SSD picture

HP Engage Flex PRO Desktop PC Intel Core i5-8500 Intel UHD 8GB DDR4 512GB SSD

$179.99



Intel NUC (32GB, Intel Core i7 8th Gen., 2.70GHz, 8GB) Desktop - BOXNUC8I7BEH1 picture

Intel NUC (32GB, Intel Core i7 8th Gen., 2.70GHz, 8GB) Desktop - BOXNUC8I7BEH1

$110.00



Intel - Core i9-13900K 13th Gen 24 cores 8 P-cores + 16 E-cores 36M Cache, 3 ... picture

Intel - Core i9-13900K 13th Gen 24 cores 8 P-cores + 16 E-cores 36M Cache, 3 ...

$689.99



Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc... picture

Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc...

$619.99



Intel - Core i7-13700K 13th Gen 16 cores 8 P-cores + 8 E-cores 30M Cache, 3.4... picture

Intel - Core i7-13700K 13th Gen 16 cores 8 P-cores + 8 E-cores 30M Cache, 3.4...

$489.99



Lenovo Thinkcentre M920Q Intel Core i5-8th gen 16GB 256GB NVMe SSD Windows11 Pro picture

Lenovo Thinkcentre M920Q Intel Core i5-8th gen 16GB 256GB NVMe SSD Windows11 Pro

$165.00



Intel NUC Core i7 8th Gen - Mini PC Kit BOXNUC8I7BEH1 picture

Intel NUC Core i7 8th Gen - Mini PC Kit BOXNUC8I7BEH1

$300.00