update internals 7
Documentation Version for Comments and Changes
You are invited to make any changes...add any comments.
Changes will `eventually` be merged into the offical documentation.
Leave any commnents here...
...
... back to index page OE documentation
The minimal Euphoria integer. This is (2^{30}).
MAXINT
<internal> signed int MAXINT
The maximal Euphoria integer. This is 2^{30}1.
HIGH_BITS
<internal> signed int HIGH_BITS
HIGH_BITS is an integer value such that if another integer value c lies outside of the range between MININT and MAXINT, c+HIGH_BITS will be nonnegative.
Proof that HIGH_BITS is #C000_0000 on 32bit version of EUPHORIA.
 In the following expressions powers have higher precedence than unuary minus.* if c is a nonATOMINT value, then
c belongs to the set [2^{31},2^{30}1(=NOVALUE)] U [2^{30},2^{31}].
c+2^{30} belongs to the set [2^{31}2^{30},2^{30}12^{30}] U [2^{30}2^{30},2^{30}] which is [3*2^{30},2^{31}1] U [0,2^{30}]. However the lower values wrap around to nonnegative numbers:
2^{31}1 wraps to 2^{31}1. 3*2^{30} wraps around to 2^{30}.
c+2^{30} belongs to the set [2^{30},2^{31}1] U [0,2^{30}] = [0,2^{31}1]
This is the set of all nonnegative numbers that can fit into 32bit signed longs. 2^{30} is the unsigned version of #C000_0000. QED.
A visual way of looking at it is, adding #C000_0000 to the set of nonATOM_INTS rotates the set to the negative side by MININT (2^30). The already negative ones wrap around to the positive; the positive numbers stay positive and hug the zero. Since adding #C000_0000 on registers is 11 and onto, we also know that ATOM_INTs will all be mapped to negative signed longs.
Testing for Overflow:
There are two ways to test for overflow:
 (c > MAXINT)  (c < MININT)
 (c + HIGH_BITS) >= 0
Parser
Inserting tokens into the token buffer is the easiest way to add features to the EUPHORIA parser. The tokens are twoelement sequences one of the class of token and the other the token's value:
{<class>,<value>}
Each of the class values are capitalized words for some keyword or VARIABLE. The list of constants is in reswords.e. Often it is enough to only examin the class. In the case of variables, it is important to know which variable. In this case the second element, comes into play.
You can use putback to put tokens into the token buffer. The tokens will be pulled out by the parser in a filo manner, like a stack.
Backend Instructions
After the Parser processes the instructions. It creates Backend instructions that are easily translated or interpreted. The system uses opcodes and some parameters which are put on a stack. This backend language is similar to assembler. You have opcodes (instructions) and parameters. These parameters must be integers themselves but some may serve as pointers to arbitrary EUPHORIA objects. As a developer of EUPHORIA itself,
Not Categorized, Please Help
