Add AI agent guide for translating C/C++ structs and datasheets to Emboss#114
Add AI agent guide for translating C/C++ structs and datasheets to Emboss#114
Conversation
Co-authored-by: AaronWebster <3766083+AaronWebster@users.noreply.github.com>
Co-authored-by: AaronWebster <3766083+AaronWebster@users.noreply.github.com>
|
@copilot The example struct is too simple. Create one struct that has ALL of the following: Virtual Fields Thoroughly review the emboss language features guide for any that I've made |
|
@copilot The example struct is too simple. Create one struct that has ALL of the following: Virtual Fields Thoroughly review the emboss language features guide for any that are not be enumerated above |
Updated Example 1 to demonstrate ALL Emboss features as requested: - Virtual fields (let) with computed values - Conditional fields (if) for optional checksum - Anonymous bits for flag bitfield - Enums (SensorType, DataQuality) - Variable-length arrays (samples) - Flags (enabled, calibrated, low_battery, checksum_present) - Requires statements (struct-level and field-level) The example has been validated by compiling with embossc. Co-authored-by: AaronWebster <3766083+AaronWebster@users.noreply.github.com>
Updated Example 1 to demonstrate ALL requested features in a single comprehensive struct: ✅ Virtual Fields - 5 examples (sensor_type, data_quality, is_reliable, timestamp_offset, has_samples) The example has been validated by compiling with embossc to ensure correct syntax. Commit: 932ac37 |
Added more language features beyond the initial request: - $next keyword throughout for automatic offset calculation - Nested struct (CalibrationData subtype) - $size_in_bytes to size fields based on nested struct - Aliases (cal_offset as alias to calibration_offset) - $present() function to check conditional field existence - Signed Int type for calibration values - text_output attribute for field visibility control Example now demonstrates 14 major Emboss features comprehensively. Validated by compiling with embossc. Co-authored-by: AaronWebster <3766083+AaronWebster@users.noreply.github.com>
Enhanced Example 1 with additional features from the language reference that weren't in the original list: Now includes 14 major features: Validated by compiling with embossc to ensure correct syntax. Commit: b31214e |
AI agents (Copilot, Gemini, Claude, etc.) need structured guidance to translate C/C++ packed structs with bitfields and electronic datasheet tables into idiomatic Emboss definitions.
Changes
doc/ai-agent-guide.md- 867-line comprehensive translation guide covering:__attribute__((packed))structs and bitfieldsREADME.mdanddoc/index.md- Added references to guide for discoverabilityExample 1: Comprehensive Feature Demonstration
Example 1 has been updated to demonstrate 14 major Emboss features in a single realistic sensor telemetry packet:
Features Demonstrated:
let) - 6 examples including computed enums, aliases, and field existence checksif) - extended_cal and checksum fields based on conditions$nextkeyword - automatic offset calculation throughout the struct$size_in_bytes- dynamic field sizing based on nested struct$present()function - check if conditional fields existtext_outputattribute - control field visibility in text outputInput (C):
Output (Emboss) - includes virtual fields, conditional fields, anonymous bits, enums, arrays, flags, requires statements,
$nextkeyword, nested structs,$size_in_bytes, aliases,$present(), signed Int, and text_output attribute all in one comprehensive example.Example 2: Datasheet Table Translation
Input (datasheet table):
Output (Emboss):
Example 3: C Bitfield Translation
Input (C bitfield):
Output (Emboss):
All examples have been validated by compiling with embossc to ensure correct syntax.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.