NEW : REBASE THE ENTIRE WORKING PROJECT

This commit is contained in:
2022-02-09 19:19:09 +01:00
parent ddad60988e
commit ae93015aa8
1338 changed files with 286867 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
"use strict";
function defineRules($, t) {
// https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-Literal
$.RULE("literal", () => {
$.OR([
{ ALT: () => $.SUBRULE($.integerLiteral) },
{ ALT: () => $.SUBRULE($.floatingPointLiteral) },
{ ALT: () => $.SUBRULE($.booleanLiteral) },
{ ALT: () => $.CONSUME(t.CharLiteral) },
{ ALT: () => $.CONSUME(t.TextBlock) },
{ ALT: () => $.CONSUME(t.StringLiteral) },
{ ALT: () => $.CONSUME(t.Null) }
]);
});
// https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-IntegerLiteral
$.RULE("integerLiteral", () => {
$.OR([
{ ALT: () => $.CONSUME(t.DecimalLiteral) },
{ ALT: () => $.CONSUME(t.HexLiteral) },
{ ALT: () => $.CONSUME(t.OctalLiteral) },
{ ALT: () => $.CONSUME(t.BinaryLiteral) }
]);
});
// https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-FloatingPointLiteral
$.RULE("floatingPointLiteral", () => {
$.OR([
{ ALT: () => $.CONSUME(t.FloatLiteral) },
{ ALT: () => $.CONSUME(t.HexFloatLiteral) }
]);
});
// https://docs.oracle.com/javase/specs/jls/se16/html/jls-3.html#jls-BooleanLiteral
$.RULE("booleanLiteral", () => {
$.OR([{ ALT: () => $.CONSUME(t.True) }, { ALT: () => $.CONSUME(t.False) }]);
});
}
module.exports = {
defineRules
};