1import{d as n,r as s,g as p}from"./chunk-MOJQB5TN-H4H86Q83.js";import{p as l}from"./chunk-JWPE2WC7-BB6pRTBG.js";import{_ as t,l as i}from"./AIDemoShowcase-BbAH1eDQ.js";import{a as u,M as f}from"./cynefin-VYW2F7L2-O9PYUeYT.js";import"./query-zKe4mOlO.js";import"./vendor-BV72JwGM.js";import"./index-b3SWkXql.js";import"./badge-DgEKWgvG.js";import"./textarea-eQE_CzYA.js";import"./select-ziSDwp_c.js";import"./index-BdQq_4o_.js";import"./index-BcFqJv69.js";import"./index-BSNYq_IR.js";import"./check-iA5WZ6OB.js";import"./play-CR9Xjm6m.js";import"./copy-CplDqpsc.js";import"./purify.es-D6gMnemd.js";import"./isArguments-HEPTc7lU.js";import"./isArrayLikeObject-DzpQn6gc.js";import"./table-DtZVbMlF.js";import"./circle-check-BIRNLulk.js";import"./arrow-left-C5xhlwR_.js";import"./git-branch-Cw6n6scQ.js";import"./book-open-1XKjOEDX.js";import"./bot-1LBfHded.js";import"./wrench-1AGdYr6P.js";import"./users-DxQaKDDx.js";import"./trending-up-IXie-JW6.js";import"./calendar-C5ZA1iBg.js";var c=u().RailroadEbnf.parser.LangiumParser,o=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(d);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),m=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return o(e.element);case"EbnfOptional":return{type:"optional",element:o(e.element)};case"EbnfRepetition":return{type:"repetition",element:o(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},m(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),d=t(e=>e.postfixes.reduce((r,a)=>b(r,a),m(e.base)),"transformTerm"),y=t(e=>({name:e.name,definition:o(e.definition)}),"transformRule"),v=t(e=>{l(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(y(r)))},"populateDb"),g={parse:t(e=>{n.clear(),i.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new f(r);const a=r.value;i.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),i.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},Q={parser:g,db:n,renderer:s,styles:p};export{Q as diagram};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.