| Author |
Message |
< User Contributions ~ Leex - a lexical analyser generator |
| rvirding |
Posted: Sat Sep 02, 2006 10:11 am |
|
|
|
User
Joined: 30 Aug 2006
Posts: 452
Location: Stockholm, Sweden
|
Here is Leex in its current state.
There is no documentation (yet) but I have included erl_scan.xrl which is the Erlang token syntax.
The section headers "Definitions.", "Rules." and "Erlang Code." areliteral strings which must occur at the begiining of a line. Only the rules section is necessary.
You nclude macros in the pattern by writing {MacroName}. Macros can reference macros. Macros are expanded "as is" without any implicit adding of parentheses.
Within the body of a rule you can access the token characters, length and line number thorugh the predefined variables TokenChars, TokenLen and TokenLine.
You return {token,Token}, {end_token,Token}, skip_token or {error,ErrorString}.
The interface to the generated scanner is the standard io interface:
string/1-2
token/2-3
tokens/2-3
format_error/1 |
Last edited by rvirding on Sat Sep 02, 2006 8:31 pm; edited 3 times in total
| Description: |
|
 Download |
| Filename: |
leex.zip |
| Filesize: |
14.91 KB |
| Downloaded: |
2742 Time(s) |
|
|
| Back to top |
|
| rvirding |
Posted: Sat Sep 02, 2006 10:51 am |
|
|
|
User
Joined: 30 Aug 2006
Posts: 452
Location: Stockholm, Sweden
|
I naturally forgot to tell how to run it:
leex:file(Name)
which reads the file Name.xrl and generates the module Name in the file Name.erl. The file leex.hrl must be in the current directory.
No options yet. |
|
|
|
| Back to top |
|
| rvirding |
Posted: Sat May 24, 2008 3:34 pm |
|
|
|
User
Joined: 30 Aug 2006
Posts: 452
Location: Stockholm, Sweden
|
This is the first proper release of leex. Changes from the previous non-release version are:
- It now has a proper open-source license.
- An elusive bug has been found to have been a bug and has been fixed.
- A cool new option dfa_graph has been added. Thanks for Sebastian Egner for showing me the possiblities.
- There is now some documentation. Yeah!
Apart from this there are no other noticeable changes. The Erlang and LFE token syntaxes are included as examples. |
| Description: |
|
 Download |
| Filename: |
leex 0.1.zip |
| Filesize: |
18.41 KB |
| Downloaded: |
2196 Time(s) |
|
|
| Back to top |
|
| 0x6e6562 |
Posted: Thu May 29, 2008 7:26 pm |
|
|
|
User
Joined: 12 Jul 2007
Posts: 250
|
|
| Back to top |
|
| rvirding |
Posted: Fri Oct 31, 2008 9:35 pm |
|
|
|
User
Joined: 30 Aug 2006
Posts: 452
Location: Stockholm, Sweden
|
This is version 0.2 of Leex. New features and changes from the previous version are:
- The structure of the release is such that you can now drop straight into your ERL_LIBS directory.
- Added includefile option. Search for include file in current directory or leex/include lib dir.
- Restored text file version of documentation until I edoc and I are in agreement.
- Upgraded erlang_scan.xrl to full erlang tokeniser.
- Now use line number of token start.
- Fixed a bug where if the file ended in an incomplete token this was ignored and no error returned. |
| Description: |
|
 Download |
| Filename: |
leex_0.2.zip |
| Filesize: |
45.72 KB |
| Downloaded: |
1821 Time(s) |
|
|
| Back to top |
|
| rvirding |
Posted: Thu Jan 01, 2009 9:56 pm |
|
|
|
User
Joined: 30 Aug 2006
Posts: 452
Location: Stockholm, Sweden
|
This is version 0.3 of Leex. New features and changes from the previous version are:
- Added options to pushback characters into the input stream.
- Can now handle full unicode character sets in both input file and generated scanner. Of course i/o system can't generate such an input file yet.
- Enforce headings for all sections of .xrl file.
- Added verbose flag to control printing of parsing information.
- Fixed bug with completely empty erlang code section.
[Edit]: I just noticed that I failed to recompile the included leex.beam file. A "make compile" will fix this. |
| Description: |
|
 Download |
| Filename: |
leex_v0.3.tgz |
| Filesize: |
39.99 KB |
| Downloaded: |
2163 Time(s) |
|
|
| Back to top |
|
| mickeyy |
Posted: Mon Feb 22, 2010 10:59 am |
|
|
|
Joined: 22 Feb 2010
Posts: 1
|
This is of great information to me. Thanks for sharing. Great job guys. Keep it up.
_________________
FXBx-Sol |
|
|
|
| Back to top |
|
|
|