Website Summary Files Commits Branches @commit @diff @stats
path: root / homework / 81319 / golang2html / README.md
blob: 63c5f5345ead94611dcf91422634d46ff8794c22 (plain) (blame)
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
# How-to guide

## Compiling the highlighter

1. Transpile flex file to c file
```
flex golang2html.flex
```

2. Compile the produced output file

```
gcc lex.yy.c -o lexer
```

The produced output is the 'lexer' file. You use it to highlight
your own golang source files.

## Highlighting Golang code

1. Create your own golang source file with whatever name you wish. For
this example, let your golang source be 'hello_world.go'.

2. Produce the highlighted html output

```
./lexer hello_world.go > hello_world.html
```

## Enjoy