Files
whetstone_DSL/editor/src/PolyParseProject.h
Bill 1f1234b28b Sprint 272: fitness-routed polyglot test projects — Phase 2 (steps 1888-1892)
Added PolyglotProjectSpec data model and three concrete 2-language test
project fixtures, all routing correctly via LanguageFitnessScorer.

New headers:
- PolyglotProjectSpec.h: PolyglotInterface, PolyglotSection, PolyglotProjectSpec,
  PolyglotFitnessRouter (explicit override + auto-routing via scorer)
- PolySortProject.h: sort-core → Rust, data-gen → Python
- PolyApiProject.h: http-server → Go, api-client → TypeScript
- PolyParseProject.h: lexer → C++, ast-transform → Haskell
- Sprint272IntegrationSummary.h

25/25 tests passing (steps 1888-1892). All new headers ≤ 600 lines.
tools/claude/tools.json: added whetstone_score_language_fitness (tool 91).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 14:17:33 -07:00

44 lines
1.8 KiB
C++

#pragma once
#include "PolyglotProjectSpec.h"
namespace whetstone {
class PolyParseProject {
public:
// Returns a fully-populated poly-parse PolyglotProjectSpec.
// lexer (FlatLoop/None/Blocking/SimpleGenerics, high mutation) → C++
// ast-transform (TailRecursive/None/None/DependentTypes, no mutation) → Haskell
static PolyglotProjectSpec make() {
PolyglotProjectSpec spec;
spec.projectName = "poly-parse";
PolyglotSection lexer;
lexer.componentName = "lexer";
lexer.features.mutationRatio = 0.35f;
lexer.features.recursionShape = ASTFeatures::RecursionShape::TreeRecursive;
lexer.features.concurrencyPrimitive = ASTFeatures::ConcurrencyPrimitive::SharedMemory;
lexer.features.ioPattern = ASTFeatures::IOPattern::Blocking;
lexer.features.typeComplexity = ASTFeatures::TypeComplexity::SimpleGenerics;
spec.sections.push_back(lexer);
PolyglotSection astTransform;
astTransform.componentName = "ast-transform";
astTransform.features.mutationRatio = 0.0f;
astTransform.features.recursionShape = ASTFeatures::RecursionShape::TailRecursive;
astTransform.features.concurrencyPrimitive = ASTFeatures::ConcurrencyPrimitive::None;
astTransform.features.ioPattern = ASTFeatures::IOPattern::None;
astTransform.features.typeComplexity = ASTFeatures::TypeComplexity::DependentTypes;
spec.sections.push_back(astTransform);
PolyglotInterface iface;
iface.fromComponent = "lexer";
iface.toComponent = "ast-transform";
iface.description = "token stream";
spec.interfaces.push_back(iface);
return spec;
}
};
} // namespace whetstone