mirror of
https://github.com/emkay/parser-6502.git
synced 2024-12-30 12:31:29 +00:00
22 lines
396 B
JavaScript
22 lines
396 B
JavaScript
const mona = require('mona')
|
|
|
|
const directive = require('./parsers/directive')
|
|
const instruction = require('./parsers/instruction')
|
|
const label = require('./parsers/label')
|
|
|
|
function assembler (input) {
|
|
return mona.parse(
|
|
mona.collect(
|
|
mona.or(
|
|
directive(),
|
|
instruction(),
|
|
label(),
|
|
mona.eol()
|
|
)
|
|
),
|
|
input
|
|
)
|
|
}
|
|
|
|
module.exports = assembler
|