2022-06-03 14:34:08 -04:00
|
|
|
// Static XML symbols
|
|
|
|
//
|
2023-01-17 23:09:25 -05:00
|
|
|
// Copyright (C) 2014-2023 Ryan Specialty, LLC.
|
2022-06-03 14:34:08 -04:00
|
|
|
//
|
|
|
|
// This file is part of TAME.
|
|
|
|
//
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
//! Static XML symbols.
|
|
|
|
//!
|
|
|
|
//! This is analogous to [`crate::sym::st`].
|
|
|
|
|
2022-08-10 16:33:46 -04:00
|
|
|
use crate::sym::st::*;
|
|
|
|
|
|
|
|
pub mod prefix {
|
|
|
|
//! Static [`Prefix`]es.
|
|
|
|
|
|
|
|
use super::super::Prefix;
|
|
|
|
use super::*;
|
|
|
|
|
|
|
|
/// Namespace prefix [`L_C`] used for calculation expressions.
|
|
|
|
pub const NS_C: Prefix = Prefix::st_cid(&L_C);
|
|
|
|
|
|
|
|
/// Namespace prefix [`L_T`] used for short-hand template application.
|
|
|
|
pub const NS_T: Prefix = Prefix::st_cid(&L_T);
|
|
|
|
}
|
|
|
|
|
2022-06-03 14:34:08 -04:00
|
|
|
pub mod qname {
|
|
|
|
//! Static [`QName`]s.
|
|
|
|
|
2022-08-10 16:33:46 -04:00
|
|
|
use super::*;
|
2022-06-03 14:34:08 -04:00
|
|
|
use crate::sym::{
|
|
|
|
CIdentStaticSymbolId, StaticSymbolId, TameIdentStaticSymbolId,
|
|
|
|
};
|
|
|
|
|
|
|
|
#[cfg(doc)]
|
|
|
|
use super::super::QName;
|
|
|
|
|
|
|
|
/// A static symbol that can be safely converted into a [`QName`] without
|
|
|
|
/// any checks.
|
|
|
|
///
|
|
|
|
/// This must only be implemented on static symbol types that are known to
|
|
|
|
/// be valid QNames.
|
|
|
|
pub trait QNameCompatibleStaticSymbolId: StaticSymbolId {}
|
|
|
|
|
|
|
|
impl QNameCompatibleStaticSymbolId for CIdentStaticSymbolId {}
|
|
|
|
impl QNameCompatibleStaticSymbolId for TameIdentStaticSymbolId {}
|
|
|
|
|
|
|
|
#[doc(hidden)]
|
2022-06-14 17:00:12 -04:00
|
|
|
// rustfmt is over-indenting the doc annotations at the time of writing.
|
|
|
|
#[rustfmt::skip]
|
2022-06-03 14:34:08 -04:00
|
|
|
macro_rules! qname_const_inner {
|
|
|
|
($name:ident = :$local:ident) => {
|
2022-06-14 17:00:12 -04:00
|
|
|
#[doc=concat!(
|
|
|
|
"QName with no namespace prefix and local name [`",
|
|
|
|
stringify!($local),
|
|
|
|
"`].",
|
|
|
|
)]
|
2022-06-03 14:34:08 -04:00
|
|
|
pub const $name: crate::xir::QName =
|
|
|
|
crate::xir::QName::st_cid_local(&$local);
|
|
|
|
};
|
|
|
|
|
|
|
|
($name:ident = $prefix:ident:$local:ident) => {
|
2022-06-14 17:00:12 -04:00
|
|
|
#[doc=concat!(
|
|
|
|
"QName with namespace prefix [`",
|
|
|
|
stringify!($prefix),
|
|
|
|
"`] and local name [`",
|
|
|
|
stringify!($local),
|
|
|
|
"`].",
|
|
|
|
)]
|
2022-06-03 14:34:08 -04:00
|
|
|
pub const $name: crate::xir::QName =
|
|
|
|
crate::xir::QName::st_cid(&$prefix, &$local);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Construct a series of [`QName`] constants.
|
|
|
|
///
|
|
|
|
/// The syntax for each constant is `NAME: [PREFIX]:LOCAL`,
|
|
|
|
/// where `PREFIX` is optional.
|
|
|
|
///
|
|
|
|
/// See [`crate::sym::st`] for usable symbol constants.
|
|
|
|
macro_rules! qname_const {
|
|
|
|
($($name:ident: $($prefix:ident)? : $local:ident,)*) => {
|
|
|
|
$(
|
|
|
|
qname_const_inner!($name = $($prefix)?:$local);
|
|
|
|
)*
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
qname_const! {
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_XMLNS_PREPROC: L_XMLNS:L_PREPROC,
|
|
|
|
QN_XMLNS: :L_XMLNS,
|
|
|
|
QN_XMLNS_C: L_XMLNS:L_C,
|
|
|
|
QN_XMLNS_L: L_XMLNS:L_L,
|
|
|
|
QN_XMLNS_LV: L_XMLNS:L_LV,
|
|
|
|
QN_XMLNS_T: L_XMLNS:L_T,
|
|
|
|
|
|
|
|
QN_ALL: :L_ALL,
|
|
|
|
QN_ANY: :L_ANY,
|
|
|
|
QN_ANY_OF: :CC_ANY_OF,
|
|
|
|
QN_APPLY_TEMPLATE: :L_APPLY_TEMPLATE,
|
|
|
|
QN_AS: :L_AS,
|
|
|
|
QN_BASE_TYPE: :L_BASE_TYPE,
|
|
|
|
QN_CLASS: :L_CLASS,
|
tamer: xir::parse::ele: Initial element parser generator concept
This begins generating parsers that are capable of parsing elements. I need
to move on, so this abstraction isn't going to go as far as it could, but
let's see where it takes me.
This was the work that required the recent lookahead changes, which has been
detailed in previous commits.
This initial support is basic, but robust. It supports parsing elements
with attributes and children, but it does not yet support the equivalent of
the Kleene star (`*`). Such support will likely be added by supporting
parsers that are able to recurse on their own definition in tail position,
which will also require supporting parsers that do not add to the stack.
This generates parsers that, like all the other parsers, use enums to
provide a typed stack. Stitched parsers produce a nested stack that is
always bounded in size. Fortunately, expressions---which can nest
deeply---do not need to maintain ancestor context on the stack, and so this
should work fine; we can get away with this because XIRF ensures proper
nesting for us. Statements that _do_ need to maintain such context are not
nested.
This also does not yet support emitting an object on closing tag, which
will be necessary for NIR, which will be a streaming IR that is "near" to
the source XML in structure. This will then be used to lower into AIR for
the ASG, which gives structure needed for further analysis.
More information to come; I just want to get this committed to serve as a
mental synchronization point and clear my head, since I've been sitting on
these changes for so long and have to keep stashing them as I tumble down
rabbit holes covered in yak hair.
DEV-7145
2022-07-13 13:55:32 -04:00
|
|
|
QN_CLASSIFY: :L_CLASSIFY,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_CONST: :L_CONST,
|
|
|
|
QN_CORE: :L_CORE,
|
|
|
|
QN_DASH: :L_DASH,
|
|
|
|
QN_DEFAULT: :L_DEFAULT,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_DESC: :L_DESC,
|
|
|
|
QN_DIM: :L_DIM,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_DISPLAY: :L_DISPLAY,
|
|
|
|
QN_DOT: :L_DOT,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_DTYPE: :L_DTYPE,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_DYN_NODE: :L_DYN_NODE,
|
|
|
|
QN_ENUM: :L_ENUM,
|
|
|
|
QN_EQ: :L_EQ,
|
|
|
|
QN_ERROR: :L_ERROR,
|
|
|
|
QN_EXPAND_BARRIER: :L_EXPAND_BARRIER,
|
|
|
|
QN_EXPAND_FUNCTION: :L_EXPAND_FUNCTION,
|
|
|
|
QN_EXPAND_GROUP: :L_EXPAND_GROUP,
|
|
|
|
QN_EXPAND_SEQUENCE: :L_EXPAND_SEQUENCE,
|
tamer: xir::parse::ele: Initial element parser generator concept
This begins generating parsers that are capable of parsing elements. I need
to move on, so this abstraction isn't going to go as far as it could, but
let's see where it takes me.
This was the work that required the recent lookahead changes, which has been
detailed in previous commits.
This initial support is basic, but robust. It supports parsing elements
with attributes and children, but it does not yet support the equivalent of
the Kleene star (`*`). Such support will likely be added by supporting
parsers that are able to recurse on their own definition in tail position,
which will also require supporting parsers that do not add to the stack.
This generates parsers that, like all the other parsers, use enums to
provide a typed stack. Stitched parsers produce a nested stack that is
always bounded in size. Fortunately, expressions---which can nest
deeply---do not need to maintain ancestor context on the stack, and so this
should work fine; we can get away with this because XIRF ensures proper
nesting for us. Statements that _do_ need to maintain such context are not
nested.
This also does not yet support emitting an object on closing tag, which
will be necessary for NIR, which will be a streaming IR that is "near" to
the source XML in structure. This will then be used to lower into AIR for
the ASG, which gives structure needed for further analysis.
More information to come; I just want to get this committed to serve as a
mental synchronization point and clear my head, since I've been sitting on
these changes for so long and have to keep stashing them as I tumble down
rabbit holes covered in yak hair.
DEV-7145
2022-07-13 13:55:32 -04:00
|
|
|
QN_EXPORT: :L_EXPORT,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_EXTERN: :L_EXTERN,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_FOR_EACH: :L_FOR_EACH,
|
|
|
|
QN_FROM: :L_FROM,
|
|
|
|
QN_FUNCTION: :L_FUNCTION,
|
|
|
|
QN_GENERATES: :L_GENERATES,
|
|
|
|
QN_GENSYM: :L_GENSYM,
|
|
|
|
QN_GENTLE_NO: :L_GENTLE_NO,
|
2022-09-21 11:59:06 -04:00
|
|
|
QN_GT: :L_GT,
|
|
|
|
QN_GTE: :L_GTE,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_ID: :L_ID,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_IDENTIFIER: :L_IDENTIFIER,
|
|
|
|
QN_IF: :L_IF,
|
|
|
|
QN_IGNORE_MISSING: :L_IGNORE_MISSING,
|
|
|
|
QN_IMPORT: :L_IMPORT,
|
|
|
|
QN_INDEX: :L_INDEX,
|
|
|
|
QN_INLINE_TEMPLATE: :L_INLINE_TEMPLATE,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_ISOVERRIDE: :L_ISOVERRIDE,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_ITEM: :L_ITEM,
|
|
|
|
QN_KEY: :L_KEY,
|
|
|
|
QN_LABEL: :L_LABEL,
|
|
|
|
QN_LOCAL: :L_LOCAL,
|
|
|
|
QN_LOWER: :L_LOWER,
|
2022-09-21 11:59:06 -04:00
|
|
|
QN_LT: :L_LT,
|
|
|
|
QN_LTE: :L_LTE,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_LV_IMPORT: L_LV:L_IMPORT,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_LV_PACKAGE: L_LV:L_PACKAGE,
|
|
|
|
QN_L_DEP: L_L:L_DEP,
|
|
|
|
QN_L_EXEC: L_L:L_EXEC,
|
|
|
|
QN_L_FROM: L_L:L_FROM,
|
|
|
|
QN_L_MAP_EXEC: L_L:L_MAP_EXEC,
|
|
|
|
QN_L_MAP_FROM: L_L:L_MAP_FROM,
|
|
|
|
QN_L_RETMAP_EXEC: L_L:L_RETMAP_EXEC,
|
|
|
|
QN_L_STATIC: L_L:L_STATIC,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_MAP: :L_MAP,
|
|
|
|
QN_MATCH: :L_MATCH,
|
|
|
|
QN_META: :L_META,
|
|
|
|
QN_METHOD: :L_METHOD,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_NAME: :L_NAME,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_NAME_PREFIX: :L_NAME_PREFIX,
|
|
|
|
QN_NO: :L_NO,
|
|
|
|
QN_NOVALIDATE: :L_NOVALIDATE,
|
|
|
|
QN_OF: :L_OF,
|
|
|
|
QN_ON: :L_ON,
|
|
|
|
QN_OVERRIDE: :L_OVERRIDE,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_PACKAGE: :L_PACKAGE,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_PARAM: :L_PARAM,
|
|
|
|
QN_PARAM_ADD: :L_PARAM_ADD,
|
|
|
|
QN_PARAM_CLASS_TO_YIELDS: :L_PARAM_CLASS_TO_YIELDS,
|
|
|
|
QN_PARAM_COPY: :L_PARAM_COPY,
|
|
|
|
QN_PARAM_INHERIT: :L_PARAM_INHERIT,
|
|
|
|
QN_PARAM_META: :L_PARAM_META,
|
|
|
|
QN_PARAM_SYM_VALUE: :L_PARAM_SYM_VALUE,
|
|
|
|
QN_PARAM_TYPEDEF_LOOKUP: :L_PARAM_TYPEDEF_LOOKUP,
|
|
|
|
QN_PARAM_VALUE: :L_PARAM_VALUE,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_PARENT: :L_PARENT,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_PASS: :L_PASS,
|
|
|
|
QN_PATH: :L_PATH,
|
|
|
|
QN_PREFIX: :L_PREFIX,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_PROGRAM: :L_PROGRAM,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_PROGRAM_MAP: :L_PROGRAM_MAP,
|
|
|
|
QN_RATE: :L_RATE,
|
|
|
|
QN_RATER: :L_RATER,
|
|
|
|
QN_RATE_EACH: :L_RATE_EACH,
|
|
|
|
QN_RETURN_MAP: :L_RETURN_MAP,
|
|
|
|
QN_RMDASH: :L_RMDASH,
|
|
|
|
QN_RMUNDERSCORE: :L_RMUNDERSCORE,
|
|
|
|
QN_SCALAR: :L_SCALAR,
|
|
|
|
QN_SECTION: :L_SECTION,
|
|
|
|
QN_SET: :L_SET,
|
|
|
|
QN_SNAKE: :L_SNAKE,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_SRC: :L_SRC,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_SUFFIX: :L_SUFFIX,
|
|
|
|
QN_SYM: :L_SYM,
|
|
|
|
QN_SYM_SET: :L_SYM_SET,
|
|
|
|
QN_TEMPLATE: :L_TEMPLATE,
|
|
|
|
QN_TERMINATE: :L_TERMINATE,
|
|
|
|
QN_TEXT: :L_TEXT,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_TITLE: :L_TITLE,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_TO: :L_TO,
|
|
|
|
QN_TRANSFORM: :L_TRANSFORM,
|
|
|
|
QN_TRANSLATE: :L_TRANSLATE,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_TYPE: :L_TYPE,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_TYPEDEF: :L_TYPEDEF,
|
|
|
|
QN_UCFIRST: :L_UCFIRST,
|
|
|
|
QN_UNION: :L_UNION,
|
|
|
|
QN_UNIQUE: :L_UNIQUE,
|
|
|
|
QN_UNLESS: :L_UNLESS,
|
|
|
|
QN_UPPER: :L_UPPER,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_UUROOTPATH: :L_UUROOTPATH,
|
tamer: xir::parse::ele: Initial element parser generator concept
This begins generating parsers that are capable of parsing elements. I need
to move on, so this abstraction isn't going to go as far as it could, but
let's see where it takes me.
This was the work that required the recent lookahead changes, which has been
detailed in previous commits.
This initial support is basic, but robust. It supports parsing elements
with attributes and children, but it does not yet support the equivalent of
the Kleene star (`*`). Such support will likely be added by supporting
parsers that are able to recurse on their own definition in tail position,
which will also require supporting parsers that do not add to the stack.
This generates parsers that, like all the other parsers, use enums to
provide a typed stack. Stitched parsers produce a nested stack that is
always bounded in size. Fortunately, expressions---which can nest
deeply---do not need to maintain ancestor context on the stack, and so this
should work fine; we can get away with this because XIRF ensures proper
nesting for us. Statements that _do_ need to maintain such context are not
nested.
This also does not yet support emitting an object on closing tag, which
will be necessary for NIR, which will be a streaming IR that is "near" to
the source XML in structure. This will then be used to lower into AIR for
the ASG, which gives structure needed for further analysis.
More information to come; I just want to get this committed to serve as a
mental synchronization point and clear my head, since I've been sitting on
these changes for so long and have to keep stashing them as I tumble down
rabbit holes covered in yak hair.
DEV-7145
2022-07-13 13:55:32 -04:00
|
|
|
QN_VALUE: :L_VALUE,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_VALUES: :L_VALUES,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_VIRTUAL: :L_VIRTUAL,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_WARNING: :L_WARNING,
|
2023-03-23 00:04:53 -04:00
|
|
|
QN_WITH_PARAM: :L_WITH_PARAM,
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_WORKSHEET: :L_WORKSHEET,
|
|
|
|
QN_YIELD: :L_YIELD,
|
2022-06-03 14:34:08 -04:00
|
|
|
QN_YIELDS: :L_YIELDS,
|
2022-08-10 16:50:02 -04:00
|
|
|
|
tamer: Introduce NIR (accepting only)
This introduces NIR, but only as an accepting grammar; it doesn't yet emit
the NIR IR, beyond TODOs.
This modifies `tamec` to, while copying XIR, also attempt to lower NIR to
produce parser errors, if any. It does not yet fail compilation, as I just
want to be cautious and observe that everything's working properly for a
little while as people use it, before I potentially break builds.
This is the culmination of months of supporting effort. The NIR grammar is
derived from our existing TAME sources internally, which I use for now as a
test case until I introduce test cases directly into TAMER later on (I'd do
it now, if I hadn't spent so much time on this; I'll start introducing tests
as I begin emitting NIR tokens). This is capable of fully parsing our
largest system with >900 packages, as well as `core`.
`tamec`'s lowering is a mess; that'll be cleaned up in future commits. The
same can be said about `tameld`.
NIR's grammar has some initial documentation, but this will improve over
time as well.
The generated docs still need some improvement, too, especially with
generated identifiers; I just want to get this out here for testing.
DEV-7145
2022-08-29 15:28:03 -04:00
|
|
|
QN_C_APPLY: L_C:L_APPLY,
|
|
|
|
QN_C_ARG: L_C:L_ARG,
|
|
|
|
QN_C_CAR: L_C:L_CAR,
|
|
|
|
QN_C_CASE: L_C:L_CASE,
|
|
|
|
QN_C_CASES: L_C:L_CASES,
|
|
|
|
QN_C_CDR: L_C:L_CDR,
|
|
|
|
QN_C_CEIL: L_C:L_CEIL,
|
|
|
|
QN_C_CONS: L_C:L_CONS,
|
|
|
|
QN_C_CONST: L_C:L_CONST,
|
|
|
|
QN_C_EQ: L_C:L_EQ,
|
|
|
|
QN_C_EXPT: L_C:L_EXPT,
|
|
|
|
QN_C_FLOOR: L_C:L_FLOOR,
|
|
|
|
QN_C_GT: L_C:L_GT,
|
|
|
|
QN_C_GTE: L_C:L_GTE,
|
|
|
|
QN_C_INDEX: L_C:L_INDEX,
|
|
|
|
QN_C_LENGTH_OF: L_C:L_LENGTH_OF,
|
|
|
|
QN_C_LET: L_C:L_LET,
|
|
|
|
QN_C_LT: L_C:L_LT,
|
|
|
|
QN_C_LTE: L_C:L_LTE,
|
|
|
|
QN_C_NE: L_C:L_NE,
|
|
|
|
QN_C_OTHERWISE: L_C:L_OTHERWISE,
|
|
|
|
QN_C_PRODUCT: L_C:L_PRODUCT,
|
|
|
|
QN_C_QUOTIENT: L_C:L_QUOTIENT,
|
|
|
|
QN_C_RECURSE: L_C:L_RECURSE,
|
|
|
|
QN_C_SUM: L_C:L_SUM,
|
|
|
|
QN_C_VALUE: L_C:L_VALUE,
|
|
|
|
QN_C_VALUES: L_C:L_VALUES,
|
|
|
|
QN_C_VALUE_OF: L_C:L_VALUE_OF,
|
|
|
|
QN_C_VECTOR: L_C:L_VECTOR,
|
|
|
|
QN_C_WHEN: L_C:L_WHEN,
|
|
|
|
|
2022-08-15 13:00:10 -04:00
|
|
|
QN_P_ELIG_CLASS_YIELDS: L_PREPROC:L_ELIG_CLASS_YIELDS,
|
|
|
|
QN_P_FRAGMENT: L_PREPROC:L_FRAGMENT,
|
|
|
|
QN_P_FRAGMENTS: L_PREPROC:L_FRAGMENTS,
|
|
|
|
QN_P_FROM: L_PREPROC:L_FROM,
|
|
|
|
QN_P_GENERATED: L_PREPROC:L_GENERATED,
|
|
|
|
QN_P_SYM: L_PREPROC:L_SYM,
|
|
|
|
QN_P_SYMTABLE: L_PREPROC:L_SYMTABLE,
|
|
|
|
QN_P_SYM_DEP: L_PREPROC:L_SYM_DEP,
|
|
|
|
QN_P_SYM_DEPS: L_PREPROC:L_SYM_DEPS,
|
|
|
|
QN_P_SYM_REF: L_PREPROC:L_SYM_REF,
|
2022-06-03 14:34:08 -04:00
|
|
|
}
|
|
|
|
}
|