|HOME |ABOUT |ARTICLES |ACK |FEEDBACK |TOC |LINKS |BLOG |JOBS |


Tutorials



E BASICS


Code Segments



A code segment is enclosed with a begin-code marker <' and an end-code marker '>. Both the begin-code and the end-code markers must be placed at the beginning of a line (left most), with no other text on that same line (no code and no comments). For example, the following three lines of code form a code segment:


EXAMPLE
<'
import eth_env;
'>



Several code segments can appear in one line. Each code segment consists of one or more statements.



Comments



e ď¬~Ales begin as a comment which ends when the ď¬~Arst begin-code marker <' is encountered.

Comments within code segments can be marked with double dashes (--) or double slashes (//)

The end-code '> and the begin-code <' markers can be used in the middle of code sections, to write several consecutive lines of comment:


<'
import eth_env;
'>

This is
several
consecutive
lines of comment

<'
min = 46;

-- This is an inline comment

max = 1500;

// This is also an inline comment

'>

Literals And Constants




Literals are numeric, character and string values specified literally in e. Operators can be applied to literals to create compound expressions. The following categories of literals and constants are supported in e:


------------------------------------------------------------
Unsized Numbers                  12, 55_32, -764
Decimal integer                  10, 23_23 .-444  
Binary integer                   0b100111,  0b1100_0101
Hexadecimal integer              0x99_aa_bb_cc
Octal integer                    0o66_123
K (kilo: multiply by 1024)       32K, 32k, 128k
M (mega: multiply by 1024*1024)  1m, 4m, 4M
-------------------------------------------------------------





Sized Numbers





--------------------------------------------------------------
Binary      A leading 'b or 'B               8'b11001010
Octal       A leading 'o or 'O               6'o45
Decimal     A leading 'd or 'D               16'd63453
Hexadecimal A leading 'h or 'H or 'x or 'X   32'h12ffab04
--------------------------------------------------------------




Predeď¬~Aned Constants




---------------------------------------------------------
Constant   Description
---------------------------------------------------------
TRUE       For Boolean variables and expressions.
FALSE      For Boolean variables and expressions.
NULL       For structs, specifiles a NULL pointer. For 
           character strings, specifies an empty string.
UNDEF      UNDEF indicates NONE where an index is expected.
MAX_INT    Represents the largest 32-bit int (231 -1)
MIN_INT    Represents the smallest 32-bit int (-231).
MAX_UINT   Represents the largest 32-bit uint (232-1).
--------------------------------------------------------




Index
Introduction
E Basics
Data Types
Operators
Struct
Units
List
Methods
Concurrency Actions
Constraints
Extend
When And Like
Events
Temporal Expressions
Temporal Operators 1
Temporal Operators 2
Synchronizing With The Simulator
Wait And Sync
Physical Virual Feilds
Packing N Unpacking
Pre Run N On The Fly
Coverage
Commands
Extendable Methods
Non Extendable Methods
And Gate Evc

Report a Bug or Comment on This section - Your input is what keeps Testbench.in improving with time!





<< PREVIOUS PAGE

TOP

NEXT PAGE >>

copyright © 2007-2017 :: all rights reserved www.testbench.in::Disclaimer