Introduction
Welcome to the release of
Expression parser version 1x8.
This is going to be a short thread as all the necessary information can be found in my other threads created about
ep, they can be seen at the bottom of this page.
What is Expression Parser?
Ep, which by the way is short for
Expression Parser, is a new scripting language created for the sole purpose of being used by MPGH members exclusively. It's meant to work along the side of C++, meaning you can directly use
ep in your C++ Applications by simply including the
ep headers and libraries. The now improved C++ portability means you can have
ep arguments (
variable_list) automatically deduced into arguments at C++ compile time.
I wanna learn more, how does it work?
Expression Parser Theoretical Introduction
Expression Parser Practical and Syntactical Introduction
Changelog
[...]
Version 1x6
Code:
- Added a few new keywords:
group
members
methods
public (W.I.P They have no meaning yet)
private (W.I.P They have no meaning yet)
- Improved some error messages
- Fixed reference bug
(Assigning a variable that was a reference never changed the original reference, only swapped them)
- New syntax rules:
following a method keyword can now have it's identifier defined within single quotes. (')
Example:
method 'x'();
It's meant to be used for operators in groups, such as:
method '='( &other )
{
x_ = other->x_;
y_ = other->y_;
};
- Fixed internal tokenizer error (' character threw an unrecognized sequence error)
- Added the following operators to internal types (integral, floating, string_literal):
'=' operator;
- Added feature to dispatch_state allowing a this ptr to be recognized through
it's arguments, and as such can later be used when looking for a variable.
note that the following example will not throw an error, but instead
the X()'s local 'x_' is implicitly selected, instead of X's 'x_' member:
group X
{
members;
var x_;
methods:
X( &x )
{
var x_;
x_ = x; // use this->x_ for explicit usage
};
method print()
{
cout << x_ << endl;
};
};
auto x = X( 10 ); // X::x_ is left unchanged, as you are implicitly selecting the local variable
// x_ instead, be careful about this!
x->print( );
Output:
undefined behaviour or 0 (depending on implementation, as you never initalize x_)
Firstly, note that, this is the intended implementation, this is not a logical error,
but instead a logical feature. No errors should arise as long as you learn the proper
usage.
Secondly, as aforementioned; the same rules apply to global vs local scope.
- Also important to note, when a group is created only the clone, constrctor, and destructor
may be automatically emitted, any operators (such '=') must always be explicitly defined.
- Since this wasn't actually around previously, enabled the access of member variables with
'->' operator, however only if their storage flag is 'public' (W.I.P).
Version 1x7
Code:
- Added a few new working keywords (means they're implemented)
break
continue
public
private
- Added the ability for a developer to specift if an argument should be a ep reference
(using the automatic deduction method) specify your argument as ep::argument_ref_ptr.
- Added implementation of binary files (use epcc to compile your *.ep file into a *.oep)
- Huge improvements/bug fixes to asignments (before you couldn't do object->x = 5, or get_x() = 5)
you can now! Yay.
Version 1x8
Code:
- Added more C++ type safety.'
You can no longer create value_reference of int and cast it to e.g double.
- Fixed an assignment bug (I forgot to change a function)
- Remade error message system completely and it now has better error messages.
- Made some changes to value reference.
VirusTotal
Sincerely,
Yamiez.