"# Introduction" "`pbook' is a very simple and useful documentation system designed by Luke Gorrie. This is a pbook processor for FoNC." "# Usage" "./pbook [--html] source > output" "# Import" { import: Object } { import: PBookParser } "Accessors for parser variables" PBookParser user: aString [ user := aString ] PBookParser fileName: aString [ fileName := aString ] "# Main" [ | parser input renderer | renderer := #tex. OS arguments do: [:arg | arg = '--html' ifTrue: [ renderer := #html ] ifFalse: [ input := (File open: arg) tokenStream. parser := PBookParser new. parser user: (OS getenv: 'USER'). parser fileName: arg. (parser perform: renderer with: input) ifFalse: [parser error: 'syntax error near: ', input printString]]]. ]