zerodds-idl-cst
Lossless concrete syntax tree for OMG IDL 4.2: tokens with attached trivia, a green/red tree that reproduces its input byte for byte.
- Source: crates/idl-cst
- API docs: docs.rs/zerodds-idl-cst
The syntax tree that keeps everything it read.
A lossless concrete syntax tree for OMG IDL 4.2: tokens carry their trivia, and a green/red tree reproduces its input byte for byte — including for a file that fails to parse, because error recovery has to hand back what it could not read.
SyntaxSpans narrows a span to the text it covers. A node's own span includes its leading trivia, which is right for reproducing the file and wrong for pointing a diagnostic at a declaration; the two questions have two answers and both live here.
This crate resolves no names and knows no types. It is the shape of the file, not its meaning; zerodds-idl-lower supplies that.
Position
- No dependency on another ZeroDDS crate.
- Built by
zerodds-idl-parse, read byzerodds-idl-lower. - Together with
zerodds-idl-parse,zerodds-idl-lowerandzerodds-astit replaces the formerzerodds-idl.
zerodds-idl-cst
Verlustfreier konkreter Syntaxbaum für OMG IDL 4.2: Tokens mit angehängter Trivia, ein Green/Red-Baum, der seine Eingabe Byte für Byte wiedergibt.
- Quelle: crates/idl-cst
- API-Docs: docs.rs/zerodds-idl-cst
Der Syntaxbaum, der alles behält, was er gelesen hat.
Ein verlustfreier konkreter Syntaxbaum für OMG IDL 4.2: Tokens tragen ihre Trivia, und ein Green/Red-Baum gibt seine Eingabe Byte für Byte wieder — auch für eine Datei, die sich nicht parsen lässt, weil die Fehlerbehandlung zurückgeben muss, was sie nicht lesen konnte.
SyntaxSpans verengt einen Bereich auf den Text, den er abdeckt. Der eigene Bereich eines Knotens schließt seine führende Trivia ein. Das ist richtig, um die Datei wiederzugeben, und falsch, um eine Diagnose auf eine Deklaration zu richten; die beiden Fragen haben zwei Antworten, und beide liegen hier.
Diese Crate löst keine Namen auf und kennt keine Typen. Sie ist die Form der Datei, nicht ihre Bedeutung; die liefert zerodds-idl-lower.
Stellung
- Keine Abhängigkeit von einer anderen ZeroDDS-Crate.
- Gebaut von
zerodds-idl-parse, gelesen vonzerodds-idl-lower. - Ersetzt zusammen mit
zerodds-idl-parse,zerodds-idl-lowerundzerodds-astdie frühere Cratezerodds-idl.