载入中...
搜索中...
未找到
eve::dnut 命名空间参考

类

struct  DnutBlock
 One top-level dialect block in a shared token buffer. 更多...
 
struct  DnutCompileOutput
 Owning outcome of compiling one .dnut document. 更多...
 
struct  DnutDiagnostic
 One structured diagnostic anchored to a .dnut source location. 更多...
 
struct  DnutToken
 One lexed token with its exact source anchor. 更多...
 
struct  SequenceAsset
 Immutable, parameterized and versioned compiled sequence. 更多...
 
struct  SequenceCommandRequest
 Immutable request emitted by a generic command node. 更多...
 
struct  SequenceCommandResponse
 Structured response returned by a generic command handler. 更多...
 
struct  SequenceConditionOutcome
 Outcome of one authored condition, as seen by the language core. 更多...
 
struct  SequenceNode
 One immutable step of a compiled sequence. 更多...
 
struct  SequenceParameter
 One typed invocation parameter declared by authored content. 更多...
 
struct  SequenceRoute
 One outgoing edge of a sequence node. 更多...
 
class  SequenceRuntime
 Caller-owned interpreter over a compiled sequence asset. 更多...
 
struct  StepContext
 Borrowed execution context handed to one step handler. 更多...
 
struct  StepField
 One declared payload field of a step type. 更多...
 
struct  StepKindDescriptor
 Owning authoring/runtime contract for one step type. 更多...
 
class  StepKindRegistry
 Canonical step vocabulary owner and runtime handler router. 更多...
 
struct  StepOutcome
 Structured outcome of one dispatched step. 更多...
 

类型定义

using SequenceCommandHandler = std::function< SequenceCommandResponse(const SequenceCommandRequest &)>
 Synchronous owner-thread handler for one command request.
 
using StepHandler = std::function< StepOutcome(const SequenceNode &, const StepContext &)>
 Consumer-owned handler for one registered step type.
 

枚举

enum class  DnutSeverity : std::uint8_t { Warning , Error }
 Severity of one .dnut source diagnostic. 更多...
 
enum class  DnutTokenKind : std::uint8_t {
  Identifier , String , Number , Punctuator ,
  EndOfFile
}
 Token classes produced by the shared .dnut lexer. 更多...
 
enum class  SequenceParameterType : std::uint8_t {
  Any , String , Integer , Number ,
  Boolean
}
 Declared value kind for one sequence invocation parameter. 更多...
 
enum class  StepShape : std::uint8_t { Instant , Await }
 Declares whether a step completes inside its call or suspends the runtime. 更多...
 
enum class  StepFieldType : std::uint8_t {
  String , Number , Integer , Boolean ,
  Any
}
 Accepted value kind of one declared payload field. 更多...
 
enum class  StepStatus : std::uint8_t { Completed , Blocked , Failed }
 Terminal state of one dispatched step. 更多...
 

函数

DnutCompileOutput compileDnutConversations (std::string_view source, const std::string &path, const StepKindRegistry &registry)
 Compile legacy conversation blocks into canonical sequence assets.
 
eve::Result< std::vector< DnutBlock > > scanDnutBlocks (const std::vector< DnutToken > &tokens, const std::string &path)
 Discover balanced top-level dialect blocks in one lexed document.
 
DnutCompileOutput compileDnut (std::string_view source, const std::string &path, const StepKindRegistry &registry)
 Compile every story block of one .dnut document.
 
EVENGINE_API_PLATFORM bool hasErrors (const std::vector< DnutDiagnostic > &diagnostics)
 Return whether any diagnostic is an error.
 
const char * dnutTokenKindName (DnutTokenKind kind) noexcept
 Return the stable lowercase spelling of a token kind.
 
eve::Result< std::vector< DnutToken > > lexDnut (std::string_view source, const std::string &path)
 Lex one .dnut source buffer into owned tokens.
 
bool isCoreSequenceNodeType (const std::string &type) noexcept
 Return whether type is a control-flow type interpreted by the runtime.
 
const char * sequenceParameterTypeName (SequenceParameterType type) noexcept
 Return the stable lowercase spelling of a parameter type.
 
const char * stepShapeName (StepShape shape) noexcept
 Return the stable lowercase spelling of a step shape.
 

类型定义说明

◆ SequenceCommandHandler

Synchronous owner-thread handler for one command request.

在文件 SequenceRuntime.h 第 54 行定义.

◆ StepHandler

using eve::dnut::StepHandler = typedef std::function<StepOutcome(const SequenceNode&, const StepContext&)>

Consumer-owned handler for one registered step type.

在文件 StepKindRegistry.h 第 96 行定义.

枚举类型说明

◆ DnutSeverity

enum class eve::dnut::DnutSeverity : std::uint8_t
strong

Severity of one .dnut source diagnostic.

枚举值
Warning 
Error 

在文件 DnutDiagnostic.h 第 14 行定义.

◆ DnutTokenKind

enum class eve::dnut::DnutTokenKind : std::uint8_t
strong

Token classes produced by the shared .dnut lexer.

枚举值
Identifier 

Bare word: keyword, field name, identifier, or bare enum value.

String 

Quoted string with escapes already resolved.

Number 

Unsigned numeric literal; sign handling belongs to the parser.

Punctuator 

One- or two-character punctuator such as {, =, ==, ->.

EndOfFile 

Synthetic terminal token; always the last element.

在文件 DnutLexer.h 第 17 行定义.

◆ SequenceParameterType

enum class eve::dnut::SequenceParameterType : std::uint8_t
strong

Declared value kind for one sequence invocation parameter.

枚举值
Any 
String 
Integer 
Number 
Boolean 

在文件 SequenceAsset.h 第 18 行定义.

◆ StepFieldType

enum class eve::dnut::StepFieldType : std::uint8_t
strong

Accepted value kind of one declared payload field.

枚举值
String 
Number 
Integer 
Boolean 
Any 

在文件 StepKindRegistry.h 第 35 行定义.

◆ StepShape

enum class eve::dnut::StepShape : std::uint8_t
strong

Declares whether a step completes inside its call or suspends the runtime.

枚举值
Instant 

The step completes synchronously; Completed continues at next.

Await 

The step may suspend the runtime.

A registered handler returning Blocked suspends until the host calls SequenceRuntime::resumeStep. A descriptor with no handler is a host-presented step: the runtime suspends and the host acknowledges with SequenceRuntime::advance.

在文件 StepKindRegistry.h 第 20 行定义.

◆ StepStatus

enum class eve::dnut::StepStatus : std::uint8_t
strong

Terminal state of one dispatched step.

枚举值
Completed 
Blocked 
Failed 

在文件 StepKindRegistry.h 第 63 行定义.

函数说明

◆ compileDnut()

EVENGINE_API_PLATFORM DnutCompileOutput eve::dnut::compileDnut ( std::string_view  source,
const std::string &  path,
const StepKindRegistry &  registry 
)

Compile every story block of one .dnut document.

Top-level blocks belonging to another dialect (for example pool or conversation) are skipped, so one file may hold several dialects without this compiler rejecting the file. Step payloads are validated against registry, which is the single source of truth for the step vocabulary: the compiler knows only the control-flow keywords if / choice / call / wait / end.

参数
sourceFull UTF-8 document text; it is not retained.
pathSource identity reported in every diagnostic.
registryStep vocabulary used to validate non-control-flow steps.
返回
Owned assets and diagnostics. An input containing errors still yields the assets that compiled cleanly, so an editor can keep working. @thread Reentrant and side-effect free; the caller owns the result. @reentrancy Invokes no callbacks. @cost Linear in the document size; allocates one token buffer and one asset per story block.

在文件 DnutCompiler.cpp 第 482 行定义.

引用了 Error, lexDnut(), output, path, source , 以及 tokens.

被这些函数引用 eve::rpg::RpgStoryCatalogue::replaceFromDnutStrict().

◆ compileDnutConversations()

EVENGINE_API_PLATFORM DnutCompileOutput eve::dnut::compileDnutConversations ( std::string_view  source,
const std::string &  path,
const StepKindRegistry &  registry 
)

Compile legacy conversation blocks into canonical sequence assets.

The accepted source shape is the existing versioned eve.dnut conversation dialect. Dialogue-owned values such as payment and state mutations are carried unchanged in node/route payloads and validated through registry; this L1 compiler never interprets those domain fields.

参数
sourceFull UTF-8 document text; it is not retained.
pathSource identity reported in every diagnostic.
registryVocabulary containing dialogue's line, choice, and command descriptors and validators.
返回
Owned sequence assets and diagnostics.

在文件 ConversationDialect.cpp 第 301 行定义.

引用了 eve::dnut::StepKindRegistry::contains(), eve::Result< void >::diagnostics(), error, Error, graph, eve::dnut::SequenceAsset::id, isCoreSequenceNodeType(), lexDnut(), node, eve::dnut::SequenceAsset::nodes, output, path, scanDnutBlocks(), source, eve::dnut::SequenceAsset::sourceColumn, eve::dnut::SequenceAsset::sourceLine, tokens, valid, eve::dnut::SequenceAsset::validate() , 以及 eve::dnut::StepKindRegistry::validate().

被这些函数引用 eve::dialogue::parseDnutDocument().

◆ dnutTokenKindName()

EVENGINE_API_PLATFORM const char * eve::dnut::dnutTokenKindName ( DnutTokenKind  kind)
noexcept

Return the stable lowercase spelling of a token kind.

在文件 DnutLexer.cpp 第 86 行定义.

引用了 EndOfFile, Identifier, kind, Number, Punctuator , 以及 String.

◆ hasErrors()

bool eve::dnut::hasErrors ( const std::vector< DnutDiagnostic > &  diagnostics)

Return whether any diagnostic is an error.

参数
diagnosticsDiagnostics collected by one frontend invocation.
返回
True when at least one entry has error severity. @thread Reentrant and side-effect free.

在文件 DnutLexer.cpp 第 233 行定义.

引用了 Error.

被这些函数引用 eve::dnut::DnutCompileOutput::hasErrors().

◆ isCoreSequenceNodeType()

bool eve::dnut::isCoreSequenceNodeType ( const std::string &  type)
noexcept

Return whether type is a control-flow type interpreted by the runtime.

参数
typeStep type name as written in the compiled asset.
返回
True for branch, choice, call, command, wait and end. @thread Reentrant and side-effect free.

在文件 SequenceAsset.cpp 第 13 行定义.

引用了 type.

被这些函数引用 compileDnutConversations().

◆ lexDnut()

EVENGINE_API_PLATFORM eve::Result< std::vector< DnutToken > > eve::dnut::lexDnut ( std::string_view  source,
const std::string &  path 
)

Lex one .dnut source buffer into owned tokens.

Every dialect shares this lexer so a single file may hold several dialects without a second, silently divergent tokenizer.

参数
sourceFull UTF-8 source text; it is not retained.
pathSource identity reported in diagnostics and in the error path.
返回
Owned tokens ending in one EndOfFile token, or a ParseError diagnostic naming the line and column of the offending text. @thread Reentrant and side-effect free; the caller owns the returned buffer. @reentrancy Invokes no callbacks.

在文件 DnutLexer.cpp 第 97 行定义.

引用了 c, column, d, EndOfFile, Identifier, line, Number, path, position, Punctuator, quote, size, source, start, String, text , 以及 tokens.

被这些函数引用 compileDnut(), compileDnutConversations() , 以及 eve::dialogue::parseDnutDocument().

◆ scanDnutBlocks()

EVENGINE_API_PLATFORM eve::Result< std::vector< DnutBlock > > eve::dnut::scanDnutBlocks ( const std::vector< DnutToken > &  tokens,
const std::string &  path 
)

Discover balanced top-level dialect blocks in one lexed document.

参数
tokensBorrowed tokens returned by lexDnut.
pathSource identity used by diagnostics.
返回
Owned block spans, or a parse failure for malformed top-level text. @thread Reentrant and side-effect free.

在文件 DnutBlockScanner.cpp 第 22 行定义.

引用了 eve::dnut::DnutBlock::beginToken, eve::dnut::DnutBlock::column, eve::dnut::DnutToken::column, depth, EndOfFile, eve::dnut::DnutBlock::endToken, eve::Diagnostic::error(), eve::dnut::DnutBlock::id, Identifier, index, eve::dnut::DnutBlock::kind, eve::dnut::DnutToken::kind, eve::dnut::DnutBlock::line, eve::dnut::DnutToken::line, Number, eve::ParseError, path, String, eve::dnut::DnutToken::text , 以及 tokens.

被这些函数引用 compileDnutConversations() , 以及 eve::dialogue::parseDnutDocument().

◆ sequenceParameterTypeName()

const char * eve::dnut::sequenceParameterTypeName ( SequenceParameterType  type)
noexcept

Return the stable lowercase spelling of a parameter type.

在文件 SequenceAsset.cpp 第 18 行定义.

引用了 Any, Boolean, Integer, Number, String , 以及 type.

被这些函数引用 eve::dnut::SequenceRuntime::start().

◆ stepShapeName()

const char * eve::dnut::stepShapeName ( StepShape  shape)
noexcept

Return the stable lowercase spelling of a step shape.

在文件 StepKindRegistry.cpp 第 44 行定义.

引用了 Await, Instant , 以及 shape.