Parser.js re-licensed under MIT
Parser.js, a language recognition tool for JavaScript RTEs, has been re-licensed under the MIT license. This change allows for wider use and modification of the tool by developers.
Parser.js is a parser generator that can be used to generate parsers for various languages. It is written in JavaScript and can be used in both browser and server environments.
The tool was originally released under the GPL license, which restricted its use and modification. However, with the change to the MIT license, developers are now free to use and modify Parser.js in their own projects without the restrictions of the GPL.
Parser.js has gained popularity among developers as a tool for generating parsers for languages such as JSON, CSS, and HTML. With the re-licensing under the MIT license, it is expected that the tool will become even more widely used and integrated into various projects.
Here's an example of how Parser.js can be used to generate a parser for JSON:
const Parser = require('parser.js');
const jsonParser = new Parser({
start: 'value',
rules: {
value: ['object', 'array', 'string', 'number', 'true', 'false', 'null'],
object: ['{', 'members', '}'],
members: ['', 'pair', 'membersList'],
membersList: [',', 'pair', 'membersList', ''],
pair: ['string', ':', 'value'],
array: ['[', 'elements', ']'],
elements: ['', 'value', 'elementsList'],
elementsList: [',', 'value', 'elementsList', ''],
string: /"([^"\\]|\\["\\/bfnrt])*"/,
number: /-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/,
true: 'true',
false: 'false',
null: 'null',
},
});
Overall, the re-licensing of Parser.js under the MIT license is a positive development for developers who use the tool and for the wider programming community.