-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lex.cs
36 lines (33 loc) · 908 Bytes
/
Lex.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
namespace Lex
{
/*
* Class: Lex
* Description: Top-level lexical analyzer generator function.
*
* History:
* This is a conversion of the JLex program which itself was based on the
* original C-based Lex tool.
*
*/
using System;
public class Lex
{
public const int MAXBUF = 8192;
public const int MAXSTR = 128;
/***************************************************************
Function: main
**************************************************************/
public static void Main()
{
String[] args = Environment.GetCommandLineArgs();
Gen lg;
if (args.Length < 2)
{
Console.WriteLine("cs-lex <filename>");
return;
}
lg = new Gen(args[1]);
lg.generate();
}
}
}