Jump to: navigation, search

Difference between revisions of "EDT:EGL Language"

Line 300: Line 300:
 
| <br>
 
| <br>
 
|-
 
|-
| bgcolor="#cccccc" | ''Byte(N)<sup>6</sup>''  
+
| bgcolor="#cccccc" | ''Bytes(N)<sup>6</sup>''  
 
| <br>  
 
| <br>  
 
| <br>  
 
| <br>  
Line 306: Line 306:
 
| <br>
 
| <br>
 
|-
 
|-
| bgcolor="#cccccc" | ''Byte<sup>7</sup>''  
+
| bgcolor="#cccccc" | ''Bytes<sup>7</sup>''  
 
| <br>  
 
| <br>  
 
| <br>  
 
| <br>  
Line 404: Line 404:
 
#Decimal with no length or decimals is a reference type with an immutable value.<br>  
 
#Decimal with no length or decimals is a reference type with an immutable value.<br>  
 
#Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.<br>  
 
#Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.<br>  
#Byte(N) is a value type similar to RBD's hex. N indicates the number of bytes in the value.<br>  
+
#Bytes(N) is a value type similar to RBD's hex. N indicates the number of bytes in the value. (In RBD, the length of a hex is the number of nibbles not the nubmer of bytes.)<br>  
#Byte with no length is a reference type with an immutable value of any length.<br>
+
#Bytes with no length is a reference type with an immutable value of any length.<br>
  
 
== Table 4: Statements  ==
 
== Table 4: Statements  ==
Line 437: Line 437:
 
| bgcolor="#cccccc" | ''Move<sup>1</sup>''  
 
| bgcolor="#cccccc" | ''Move<sup>1</sup>''  
 
| <br>  
 
| <br>  
| <br> N/S
+
| <br>  
| <br> N/S
+
| <br>
| <br> N/S
+
| <br>  
 
|-
 
|-
 
| bgcolor="#cccccc" | ''Return''  
 
| bgcolor="#cccccc" | ''Return''  
Line 636: Line 636:
 
'''Notes on Table 4'''<br>  
 
'''Notes on Table 4'''<br>  
  
#In RBD, a move statement between two references does a deep copy. Reference types should include a deep copy function to provide the same functionality in EDT.<br>
+
#EDT won't support every variation of RBD's move statement. There will be support for '''move byName''', '''move for''', and '''move for all'''. A move statement without one of the additional keywords is only allowed between two references, and it results in the target being assigned a copy of the source's value. If/when we support structured records, we might not support '''move byName''' on them because of the complex (unclean) design.
#EDT doesn't have called programs, but services and native programs can be called.<br>
+
#EDT doesn't have called programs, but services and native programs can be called.  
#EDT's foreach statement will support iterating over an array.<br>
+
#EDT's foreach statement will support iterating over an array.
#Support for these statements is tentative, pending the design for JPA in EDT.<br>
+
#Support for these statements is tentative, pending the design for JPA in EDT.
 +
 
 +
== Table 5: Literals  ==
 +
 
 +
{| width="400" cellspacing="1" cellpadding="1" border="1" style=""
 +
|-
 +
| bgcolor="#999999" align="center" | '''''Literals'''''
 +
| bgcolor="#999999" align="center" | '''Core'''
 +
| bgcolor="#999999" align="center" | '''JavaScript'''
 +
| bgcolor="#999999" align="center" | '''Java'''
 +
| bgcolor="#999999" align="center" | '''Debug'''
 +
|-
 +
| bgcolor="#cccccc" | ''null''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''boolean<sup>1</sup>''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''integer<sup>2</sup>''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''fixed-decimal<sup>3</sup>''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''floating point''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''string<sup>4</sup>''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''bytes<sup>5</sup>''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''array''
 +
|
 +
|
 +
|
 +
|
 +
|-
 +
| bgcolor="#cccccc" | ''char''
 +
|
 +
| N/S
 +
| N/S
 +
| N/S
 +
|-
 +
| bgcolor="#cccccc" | ''mbchar''
 +
|
 +
| N/S
 +
| N/S
 +
| N/S
 +
|-
 +
| bgcolor="#cccccc" | ''dbchar''
 +
|
 +
| N/S
 +
| N/S
 +
| N/S
 +
|-
 +
| bgcolor="#cccccc" | ''hex''
 +
|
 +
| N/S
 +
| N/S
 +
| N/S
 +
|}
 +
 
 +
'''Notes on Table 5'''<br>  
 +
 
 +
# As in RBD, there are four boolean literals: true false yes no
 +
# Integer literals have 1-32 digits, an optional leading sign, and no decimal point.  The type of the literal depends on the value.  If the value fits in a smallint, then the type is smallint.  If the value doesn't fit in a smallint but it does fit in an int, then the type is int.  Similarly for bigint.  If the value is too large for a bigint, then the type is decimal(X), where X is the number of digits in the value.
 +
# Fixed-decimal literals have 1-32 digits, an optional leading sign, and a decimal point.  At least one digit must follow the decimal point, but it's permissible to have no digits before the decimal point.  The type of a fixed-decimal literal is decimal(X,Y), where X is the total number of digits and Y is the number of digits to the right of the decimal point.
 +
# String literals are enclosed in double quotes.  An optional ux prefix may appear before the opening double quote.  The ux prefix means the string is defined as Unicode codepoints in hexadecimal.  For example "012" and ux"003000310032" have the same value.  The letters u and x may be in any case.
 +
# A bytes literal is written as 0x or 0X followed by an even number of hexadecimal digits.  For example 0x03AB is a literal whose type is bytes(2).
  
== What's left...<br>  ==
+
== What's left... ==
  
*Revisit decision to not support date and time
 
*Revisit decision to not support char and structured records
 
*Revisit decision to not support move
 
*Revisit decision to not support set (empty and initial)
 
*Literals
 
**null
 
**boolean
 
**integer, fixed-decimal, floating-point
 
**string
 
**char, mbchar, dbchar, hex
 
**literal array
 
**byte
 
**date, time, timestamp
 
 
*Operators and expressions  
 
*Operators and expressions  
 
**result of errors in each case?
 
**result of errors in each case?

Revision as of 15:12, 5 July 2011

General Notes

  • This document is not finished yet!
  • "N/S" means Not Supported.
  • Anything that exists in RBD but isn't mentioned here is not included in EDT. Or maybe we forgot about it. Nobody's perfect.
  • The work in the Core category includes the parser, model, and validation.
  • The work in the JavaScript, Java, and Debug categories includes both the generator and runtime.
  • Developers: include a link to Bugzilla for features not done yet, and mark items "Done" when you're finished.
  • EDT:Discussion topics from the language meetings

Table 1: Part Types

Part Types Core JavaScript Java Debug
DataItem1



Function2, 5



Top-level function2, 5



Delegate2



Record




Structured Record

N/S N/S N/S
ExternalType




Handler




Library




Service




Interface3




Enumeration




Program4

N/S


Array




Nullability




DataTable

N/S N/S N/S
Form

N/S N/S N/S

Notes on Table 1

  1. In RBD a DataItem can only be used for primitive types. In EDT it can be used for any type.
  2. See also Table 2: Function Parameters.
  3. Interfaces can be implemented by services and handlers (every kind of "logic part" which can be instantiated).
  4. There are no called programs. Use libraries for "local calls" and services for "remote calls".
  5. We intend to support function overloading in all implementations, even JavaScript.

Table 2: Function Parameters

Function Parameters Core JavaScript Java Debug
In1



Out



Inout1



Ellipsis



Const



Field

N/S N/S N/S
SqlNullable

N/S N/S N/S

Notes on Table 2

  1. The default parameter modifier is In for references and Inout for values.

Table 3: Primitive Types

Primitive Types Core JavaScript Java Debug
Any



Boolean



Dictionary



String(N)1



String2



Timestamp3



Blob
N/S


Clob
N/S


Smallint



Int



Bigint



Decimal(N,M)



Decimal(N)



Decimal4



Float



Smallfloat



Number5



Bytes(N)6



Bytes7



Arraydictionary

N/S N/S N/S
Char

N/S N/S N/S
Dbchar

N/S N/S N/S
Mbchar

N/S N/S N/S
Unicode

N/S N/S N/S
Hex6

N/S N/S N/S
Date3

N/S N/S N/S
Time3

N/S N/S N/S
Interval3

N/S N/S N/S
Bin

N/S N/S N/S
Num

N/S N/S N/S
Numc

N/S N/S N/S
Pacf

N/S N/S N/S
Money

N/S N/S N/S

Notes on Table 3

  1. String(N) is a reference type in EDT.
  2. String is a reference type in EDT.
  3. Timestamp is the only supported date/time type. Use it in place of RBD's date, time, and interval. Date/time math produces timestamps or numbers.
  4. Decimal with no length or decimals is a reference type with an immutable value.
  5. Number is a reference type with an immutable value. Unlike in RBD, number variables can be declared anywhere a variable declaration is allowed.
  6. Bytes(N) is a value type similar to RBD's hex. N indicates the number of bytes in the value. (In RBD, the length of a hex is the number of nibbles not the nubmer of bytes.)
  7. Bytes with no length is a reference type with an immutable value of any length.

Table 4: Statements

Statements Core JavaScript Java Debug
Variable declaration



Const declaration



Assignment



Move1



Return



Function invocation



Call2



Label



Transfer
N/S


Throw



Try



Case



If



While



For



Foreach3



Exit



Continue



Empty statement (a semicolon)



Add
N/S


Close
N/S


Delete
N/S


Get
N/S


Replace
N/S


Execute4
N/S


Prepare4
N/S


Open4
N/S


FreeSQL4
N/S


Goto

N/S N/S N/S
Set

N/S N/S N/S
Converse

N/S N/S N/S
Display

N/S N/S N/S
Print

N/S N/S N/S
Forward

N/S N/S N/S
Show

N/S N/S N/S
OpenUI

N/S N/S N/S

Notes on Table 4

  1. EDT won't support every variation of RBD's move statement. There will be support for move byName, move for, and move for all. A move statement without one of the additional keywords is only allowed between two references, and it results in the target being assigned a copy of the source's value. If/when we support structured records, we might not support move byName on them because of the complex (unclean) design.
  2. EDT doesn't have called programs, but services and native programs can be called.
  3. EDT's foreach statement will support iterating over an array.
  4. Support for these statements is tentative, pending the design for JPA in EDT.

Table 5: Literals

Literals Core JavaScript Java Debug
null
boolean1
integer2
fixed-decimal3
floating point
string4
bytes5
array
char N/S N/S N/S
mbchar N/S N/S N/S
dbchar N/S N/S N/S
hex N/S N/S N/S

Notes on Table 5

  1. As in RBD, there are four boolean literals: true false yes no
  2. Integer literals have 1-32 digits, an optional leading sign, and no decimal point. The type of the literal depends on the value. If the value fits in a smallint, then the type is smallint. If the value doesn't fit in a smallint but it does fit in an int, then the type is int. Similarly for bigint. If the value is too large for a bigint, then the type is decimal(X), where X is the number of digits in the value.
  3. Fixed-decimal literals have 1-32 digits, an optional leading sign, and a decimal point. At least one digit must follow the decimal point, but it's permissible to have no digits before the decimal point. The type of a fixed-decimal literal is decimal(X,Y), where X is the total number of digits and Y is the number of digits to the right of the decimal point.
  4. String literals are enclosed in double quotes. An optional ux prefix may appear before the opening double quote. The ux prefix means the string is defined as Unicode codepoints in hexadecimal. For example "012" and ux"003000310032" have the same value. The letters u and x may be in any case.
  5. A bytes literal is written as 0x or 0X followed by an even number of hexadecimal digits. For example 0x03AB is a literal whose type is bytes(2).

What's left...

  • Operators and expressions
    • result of errors in each case?
    • . (member access)
    • =
    • function invocation
    • new
    • { } (set-values block)
    • @
    • [ ] (array access)
    • [ ] (dynamic access)
    • [ ] (substring), as L-value and R-value
    • as
    • isa
    • % * ** / %= *= **= /=
    • + - (both binary and unary) += -=
    •  :: ::=
    • ?: ?:=
    • && || And Or !
    • < > <= >= == !=
    • & | Xor &= |= Xor=
    • is/not systemType
    • is/not blanks, numeric
    • is/not trunc, cursor, data, modified
    • is/not IO error states
    • like
    • matches
    • in
  • Conversions
    • result of conversion errors?
    • defaultNumericFormat, defaultMoneyFormat, defaultTimestampFormat, defaultDateFormat, defaultTimeFormat
    • numeric to/from numeric
    • string to/from numeric
    • string to/from boolean
    • string to/from byte
    • string to/from timestamp
    • numeric to/from boolean
    • numeric to/from byte
    • numeric to/from timestamp
    • byte to/from boolean
    • byte to/from timestamp
    • boolean to/from timestamp
  • Stereotypes
    • program stereotypes
      • BasicProgram
      • UIProgram
      • TextUIProgram
      • VGWebTransaction
    • library stereotypes
      • BasicLibrary
      • NativeLibrary
      • RUIPropertiesLibrary
    • record stereotypes
      • BasicRecord
      • Exception
      • SQLRecord
      • CSVRecord
      • DLISegment
      • PSBRecord
      • IndexedRecord
      • RelativeRecord
      • SerialRecord
      • MQRecord
      • ConsoleForm
      • VGUIRecord
    • handler stereotypes
      • BasicHandler
      • RUIHandler
      • RUIWidget
      • BirtHandler
      • JasperReport
      • JSFHandler
    • externaltype stereotypes
      • NativeType
      • JavaObject
      • JavaScriptObject
      • HostProgram
    • datatable stereotypes...form stereotypes...
  • Annotations (details TBD)
  • Language compliance test (details TBD)