Last changes in the Scriptol To PHP compiler
21.4 - April 2021
- Supports PHP 8.
- Indexing a character in a string with a variable now uses square brackets instead of curly braces.
16.7 - July 2, 2016
- Supports PHP 7.
- In a class, the constructor name generated in the target language is now "__construct".
15.8 - July 21, 2015
- Fixed line number displayed on errors, miscalculated after # comments.
15.6 - June 10, 2015
- Added the JavaScript template format for a string on multiple lines with interpolation.
- Template are converted to list of associated strings in the PHP code.
- But in a XML tag, a template is converted to a single quoted string.
- The boolean type may be declared bool or boolean now.
- Changed code generated to intersection or union of arrays, for compatibility with new PHP interpreters.
- Changed code generated to removing an item from an array, for compatibility with new PHP interpreters.
15.05.1 - May 12, 2015
- Added a flag to the store method of array, to add the eol code or not.
15.05 - May 5, 2015
- The static, private, protected modifiers are now generated in the PHP code. (Only static is checked at Scriptol level).
- Loading an XML file into a dict is now supported.
- Added the getById, getByName, setByIt methods to dict.
- Let is deprecated in a if statement and replaced by then.
- The else keyword may be replaced by ":".
- So a shortcut for "if --- then --- else" is "if --- ? --- : ---".
- The scriptol.php library is now required but only for XML functions.
- Conditionnal assignment is now deprecated.
14.10 - October 1, 2014
- Include statement now allows to include target files when compatible with the target language.
- Array.store() converted to a simpler PHP code.
14.08 - September 2014 - This version implements Scriptol 2.
- The dyn keyword is deprecated and replaced by var.
- ` and `` signs are deprecated and replaced by #.
- The constant keyword is deprecated and replaced by const.
- Added the super keyword to call the constructor of a superclass from an inherited class.
- It is now possible to display arrays with the print command.
- Added the scanDir function to get the content of a directory to an array.
- Added the sign function.
- Added the is_dict function.
- Added the ord function.
- Added the findLast method to text, to find the last occurence of a substring.
- Dict's unshift method now has two argument, the key and the value.
- Text's replace method was void and now returns a text.
- Text's fill method was void and now returns a text.
- Array's unique method was void and now returns an array.
- The second parameter of the pad function is now mandatory.
- The method len of text is deprecated.
- Added a length method to array.
- Added the toFile method to text.
- Added fileToText and fileToArray builtin functions.
- When the name of a method differs from that of the class by the case only, an error message is thrown.
- Static attributes of classes are now created with the static keyword, added in a recent version of PHP instead of the previous trick.
- To pass a function as parameter of another function, the argument is defined with the function type, and the parameter is the name of the function without parenthesis. The define statement is now useless.
- Added the rsort builtin function. The SORT_REGULAR and SORT_NUMERIC option are now recognized on sort and rsort.
- For in is compiled now to foreach. This control structure was added to PHP after the compiler was designed, it is now supported.
- Added support to binary literal.
- Removed any support to Java. Java is used through external libraries with PHP 5.
14.04 - April 2014
- Compiler updated for the last version of PHP (local time and GD still raises warnings in demos but this is not related to the compiler).
- Removed the editor.
- Removed Java and XUL files.
7.0 - August 2007
- The @ symbol is now implemented to prevent PHP functions to display warnings on Web pages.
- Constants are now really translated to PHP constant (with the define statement).
- Constants may be declared extern now.
- The 'scan by' control supports only one array now for compatibilité with array_walk of PHP 5.
- Included the FTP interface in the archive.
- Included the Winbinder interface too.
6.3 - September 2006
- Variables may be embedded into double-quoted strings with a $ prefix. Adding a $ prefix to the string is now deprecated.
- XML declaration recognized. Not used for now.
6.2 - August 2006
- Compatibility with PHP 5 improved.
- Added the -4 option for compatibility of this edition with PHP 4. This is limited to the syntax, new functions are not available with the PHP 4 interpreter.
6.1 - June 2006
- The date works. The usual format is date("c", x), x may be returned by time() or filetime().
- The "c" option works only with PHP 5.
6.0 - May 2, 2006. The compiler is now compatible with PHP 5. Scriptol PHP 4 is still supported.
- Compatibility with PHP 5.
- The "match" command, previously deprecated, is no longer supported.
- This version of the compiler is compatible with PHP 4 for now, even if a version for PHP 4 exists.
5.7 - December 1, 2005
- Double-quotes sign inside single-quoted string are now escaped in the target PHP code, as dollar and curly braces.
5.6 - October 25, 2005
- These functions are now built-in : round, filetype, exec.
- toString method added to array.
5.5 - August 25, 2005
- These methods are now built-in:
- opendir, readdir, closedir.
- is_dir, is file.
- filetype, filetime, file_exists - Dir.get() added to dir methods (requires dir.sol included).
5.4 - July 25, 2005
- The archive is splitted into two files, one for the Scriptol to PHP compiler, the other one for the Scriptol to C++ compiler.
- The dir keyword is added to
5.3 - June 25, 2005
- Multi-line strings are enclosed inside ~~ .. ~~ markers and may be assigned to variables.
- Added time() and localtime() to built-in functions.
- For full compatibility, PHP compatible literal string are
written:
$"string" or $'string'
and C compatible string are written:
"string" or 'string'.
5.2 - May 2005
- Added the input keyword to the language.
- Methods on numbers are replaced by constructors and deprecated.
- The randomize built-in function requires now one argument.
- These functions are now built in: cos, sin, tan, acos, asin, atan, ceil, floor, log, exp, abs, sqrt.
5.1 - April 2005
- Overloading of both static and non static method is now allowed.
- The reference manual has been relooked. The old tutorial is now integrated into the reference manual.
- Added these methods to dyn: isArray, isText, isNumber, isReal, isBoolean, isNatural, isInt, isInteger, isFile.
- Added the cat method to text.
4.7 December 2004
- Line feed may be inserted inside enum structures.
- Typed arrays of int, text, real, etc... are now parts of the common language.
4.6 September 2004
- It is now possible to align on the next line the ending curly brace in literal arrays, for better readabilty.
- The isNumber() method is added to text .
- a new keyword cstring, is now recognized by the compiler and replaces both external types string and char *.
- The compilers have been modified to work better in the console of Windows XP.
- Extended the include statement to allow numerical sub-directories.
- Arrays of natural, real and number are now implemented.
4.5 July 2004 - Changes in the C++ version only.
4.4 June 2004
- Improved JavaScript generator by including the declaration of
the external dom class.
4.3 March 2004
- Implemented the new concept of Scriptet.
- Unlimited number of dimensions is allowed to arrays. This works for both PHP and C++ targets.
- Literal array implemented: a list of elements enclosed between curly braces.
- Insert() and reserve() methods added to text.
- Examples demonstrating how to enter a text from the console or a web page, now included.
4.2 March 2004 - Changes in the C++ version only.
4.1 February 2004
- The nil assigment to remove an element from a dict is now working: x["str"] = nil.
- A typed literal array is denoted by curly braces: Ex: int { ... }
3.10 November 2003
- The double symbol ~~ allows to insert code directly into the target listing.
- A natural is a "unsigned __int64" in C++ and a int in PHP, and a natural literal is terminated by "n".
- Real numbers are better handled with this version.
- Literal strings may be several lines now.
3.9 Octobre 2003
- PHP 5 partially implemented and -5 option allows to produce PHP 5 compatible code.
- Exceptions are handled with the try catch structure. Works with the C++ and PHP 5 targets. This is alpha feature.
- An import ... /import tag is added to declare content of external Java classes.
3.8 September 2003
All editions:
- Added the boolval built-in function for compatibility with Visual C.
- Description of classes of the library added to the libdoc subdirectory.
Enterprise edition:
- A typed array of objects is now implemented.
3.7 July 2003
- Now the Scriptol to PHP compiler produces indented PHP code.
- Typed array of int and text are now recognized.
- A multi-lingual preprocessor is integrated.
3.6 June 2003
- Added the reverse method to arrays.
- The common compilers are now absolutely free for anyone and any program.
- The enterprise edition of the compiler is generated by the install command.
3.5 April-May 2003
- The define type = "function" statement allows to use functions as arguments.
- The "function" keyword is deprecated, but still working in the Scriptol to PHP version.
- An instance is declared by assigning the constructor (without the "new" operator) to the identifier.
- No other syntax is supported now.
- A PHP or C++ array may be prefixed by the $ symbol.
3.4 April 2003 - - Changes in the C++ compiler only.
3.3 March 2003
- "define ident" allows to integrate a new type from an external library, for compatibility with C++.
3.2 February 2003
- If an include statement holds a filename without the ".sol"
extension, the file is not parsed.
With the Scriptol C++ compiler, the statement is transmitted to the C++ target code. - Creating an instance of class with a "null" assignment allows to use extern PHP classes.
3.1 January 2003
- The "using xxx" statement produces a C++ "using namespace xxx;" statement. No effect when compiled to PHP.
2.11
- Now you can use static variables without the need to declare any instance of the class.
2.10
- The language now allows to declare a class or a virtual
object just by invoking its constructor.
Ex: print Object(10)
is equivalent to: Object o(10); print o - The constructor of an int or a text may be used for conversion
purpose.
Ex:
text a = "12"
int x = int(a) - Options at command line may be combined:
solp -br xxxx is equivalent to solp -b -r xxxx
2.9
- The one-statement "if" and other one-statement control structures (for orthogonality) may be written now without the "let" symbol if the following statement starts with a keyword (break, continue, return, print, echo, define). Ex: if x < y break (instead of if x < y let break).
- Added the "plural" function to built-in.
- You can now pass comments to the target code with the double `` comment symbol.
- Now you can declare a class inside "extern" tags (useful for Java classes)
2.08 August 2002
- Changes in the C++ compiler only.
2.07 July 2002
- Changes in the C++ compiler only.
2.06 June 28, 2002 First public release of the C++ version.
- The version number is the date for this compiler: 2 = year 2002, 6 = month june, a letter may follow.
1.6a July 15, 2002
- Now the binary operators & | ^ are usable with arrays also, for intersection, union and complement of intersection. The || and # old operators are deprecated.
- Compound assignment with union of arrays is now available.
- the doXXX cast methods on dynamic object are replaced by toXXX and setXXX are suppressed.
- The Scriptol to PHP compiler is now invoqued by solp on Windows & Linux and the Scriptol to C++ one by solc.
1.6 July 1, 2002
- External variables and constants now can start with an underscore (not Scriptol ones). Ex: $(__FILE__).
- Added the method "empty" to array.
- Added several built-in functions. Look at the reference manual.
- Now "extern" is a tag: you can enclose several external declarations between extern and /extern.
1.5b June 7, 2002
- A variable declared inside the heading of a "for" control structure is now local to the block of statements, for compatibility with ANSI C++.
- The "append" array's method is now useless. Suppressed.
- Now both + and - operators are allowed on an array with a scalar.
- The "merge" method is deprecated, but not suppressed for now.
- In 4.2.1 version, the PHP staff has corrected the "array_unique" function. This may causes some difference when your program use the "unique" virtual method or the union operator.
- Unique now returns void.
- The "main" function has changed for compatibilty with C++.
1.5a May 21, 2002
- Arrays are indexed list, dicts are associative ones. The difference is reinforced to not be confused by indices and numerical keys.
- Array and dict are no longer compatibles types.You can't assign one with the other, add them, etc... You still can use the "values()" method to convert a dict to array.
- A "pack()" method replaces the "arrange()" one.
- The "unique" method now return void.
- Splicing a dict with another dict retains the keys (PHP loses them). For array, splicing causes a "pack".
1.5 May 2, 2002
- Implemented an automatic cast for int variables assigned with real numbers. Sorry but this may cause some differences in previously written program but allows for full compatibility with the coming C++ version...
- Option -quiet added to.
- In the last version, not relevant error message may be thrown when an error occur, corrected.
1.4a April 16, 2002
- Method "store" added to array, allowing saving it in a file (no PHP equivalent).
1.4 beta April 11, 2002
- Now you can declare "extern" any PHP variable, constant or function and use it as scriptol object, with control of type at reference or assignment.
1.3 Final April 4, 2002
- The final 1.3 version is available for Windows and Linux.
1.3c April 2, 2002
- Static attributes are now allowed. PHP has static methods but lacks for static attributes, however Scriptol bypass this limitation when compiling into PHP.
- Added tests on static methods.
- The let final element now is generalized for any one-line statement (along with "?").
1.3b March 26, 2002
- Added "-verbose" to the list of options.
- No any message is displayed when running a program, now (but if -v option is passed).
- The "not in" operator previously was not working on arrays. Corrected.
- The tutorial is now included into the archives.
1.3a Win/Linux March 18, 2002
- The archive is smaller once I have replaced the BCC 5.4 compiler by MingW 2.95.3.
- The Linux version now can run the PHP code once it is compiled.
1.3a Windows March 12, 2002
- Modified some system calls for the program to run under Unix as under Windows.
1.3 beta February 20, 2002
- Now all tests on idents ignore truly case to prevent errors at runtime, as PHP is not case-sensitive (for identifiers of functions).
- The "static" keyword is now recognized by the compiler for a method.
1.2 final February 15, 2002
1.2e beta February 13, 2002
- Improved subscripting. Now the compiler recognizes a statement as ident[i][x..y] , providing that the i element is an list or a text.
1.2d beta February 7, 2002
- Reduced the size of the compiler.
- Now a script is launched directly when the compilation is successful, and thus you do not see difference with an interpreted language! (apart that errors are all detected at compile time, a Net advantage).
- Now an instance of class may be declared in any scope (including another class).
- Conditional assignment with the := operator lets the target assigned if the source is not nil or the target not assigned yet. (This is in level 2.)
1.2c beta January 25, 2002
- The annoying file to include "scriptol.PHP" is no longer required.
- Now splicing is available for text also. Thus slicing and splicing can operate on text, array and dict.
1.2b beta January 21, 2002
- Extended methods to dynamic variables with empty [] indices.
- The method toText of array and toArray of text has been replaced by join and split to avoid eventual confusions.
- The "in" operator can now be used also in composite if.
- The "match" operator now works in any relational expression. The "swap" option added to the define statement.
- The "Match" chapter moved to the new Level II reference manual (this has no effect on the compiler).
- Now an array initializer accepts any expression as element.
- Added to built-in the "swap" function.
- Built-in functions and virtual methods are no longer case-sensitive.
1.2a beta January 17, 2002
- Simplified the language, array and dict are unified with a common set of methods.
- Now dynamic variables have all the methods of any type.
- And thus one can now invoque a method on an element of an array,
for example: print myarray[10].upper()
One can also chain the methods: myarray[10].lower().capitalize() - Post-casting is a new set of methods that give a type to dynamic variables: doInt(), doText(), etc...and dynamic variables may be changed to typed ones with setInt(), setText(), etc...
- A new type of var is implemented: "function", that allows to pass functions as parameters.
- By assigning "nil", you can now remove an element or a range of an array or dict.
- Added to text the method "dup".
1.1 final January 11, 2002
- Implemented inheritance of class.
- The method "compare" now compares lexicographically (no case).
- The method "identical" performs case-sensitive comparison.
1.0p January 9, 2002
- Added the union || operator to complete operators on lists.
1.0n January 7, 2002
- Added these methods to text: toInt(), toReal().
- Added the toText() method to integer and real (or number).
1.0m January 2, 2002
- Support to Java now available.
- Methods may be chained now, ex: a ="DEMO"
a.lower.capitalize() ...returns "Demo" - Now you can assign several variables the elements of array or dict by a multiple assignment..
- Multiple assignment allowed to call of function returning a single value.
- Added the classical "str" to list of built-in functions. It is equivalent to strval.
- Both array and dict now has a sort and a kSort method, the first sorting the values and the second sorting the indexes or keys.*
1.0l December 28, 2001
- A method may be associated to a literal. For text literal mainly.
Ex: "DEMO".length() returns 4.
1.00 First version, October 22, 2001.
- Several updates followed until the 1.0l one.