mirror of
https://github.com/emkay/parser-6502.git
synced 2024-12-22 06:29:27 +00:00
24 lines
478 B
JavaScript
24 lines
478 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
|
|
// const result = mona.parse(mona.collect(assembler()), c)
|
|
// console.log(result)
|