{"id":"integer-expression-parse","version":"1.0.0","description":"Parse an integer expression and return its tokens, required variables, precedence tree, and precedence table.","supported_operations":["parse integer expression without evaluating","show tokens in a bitwise arithmetic formula","find variables needed by an integer expression","show operator precedence tree for shifts and masks","validate exact integer expression syntax","parse hexadecimal binary and octal expression","inspect floor division and modulo expression","explain integer expression grouping"],"unsupported_operations":["evaluate or substitute variable values","execute function calls or arbitrary code","parse decimal or floating-point literals"],"semantics":["Literals are decimal or 0x hexadecimal, 0b binary, or 0o octal integers; names match [A-Za-z_][A-Za-z0-9_]{0,31}. Decimal literals consist of 0 or a nonzero first digit followed by digits. A leading zero followed by another digit (including 00, 012, and 08) is invalid_input; octal uses the explicit 0o prefix.","Precedence from highest to lowest is parentheses; power ** (right associative); unary - and ~; * / // % rem; + -; << >>; &; ^; |. This follows Python 3.12, except the explicit rem spelling and C division mode.","Parsing validates syntax only and returns tokens, sorted required variable names, a precedence tree, and the precedence table. It never substitutes variables or evaluates operations.","Exponent and shift operands may be negative or exceed evaluation limits, and division/remainder operands may be zero. These are valid syntax; evaluation restrictions belong exclusively to integer-expression-evaluate.","Only input bytes, tokens, operators, depth, literal digits, unique variable names, and serialized output bytes are bounded by this parse-only contract.","max_input_bytes bounds the UTF-8 byte length of JSON.stringify(input), including keys, punctuation, and every field. Field bounds apply together with this whole-input bound.","max_expression_bytes bounds only the expression string in UTF-8; variable names and values have their separately declared limits."],"limits":{"max_input_bytes":16384,"max_tokens":256,"max_operators":128,"max_depth":32,"max_literal_digits":128,"max_variables":64,"max_output_bytes":2048,"max_expression_bytes":1024},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["expression"],"properties":{"expression":{"type":"string","minLength":1,"maxLength":1024,"description":"ASCII integer expression; UTF-8 input is capped at 1024 bytes."}}},"output_schema":{"type":"object","additionalProperties":false,"required":["standard_version","tokens","variables","precedence_tree","precedence"],"properties":{"standard_version":{"type":"string","const":"Python 3.12 §6.5–6.9; ISO/IEC 9899:2018 §6.5.5"},"tokens":{"type":"array","maxItems":256,"items":{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"type":"string","enum":["integer","name","operator","lparen","rparen"]},"text":{"type":"string","minLength":1,"maxLength":130}}}},"variables":{"type":"array","maxItems":64,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":32}},"precedence_tree":{"type":"string","minLength":1,"maxLength":4096},"precedence":{"type":"array","minItems":8,"maxItems":9,"items":{"type":"string","minLength":1,"maxLength":80}}}},"examples":[{"input":{"expression":"base + index * 4"},"output":{"standard_version":"Python 3.12 §6.5–6.9; ISO/IEC 9899:2018 §6.5.5","tokens":[{"type":"name","text":"base"},{"type":"operator","text":"+"},{"type":"name","text":"index"},{"type":"operator","text":"*"},{"type":"integer","text":"4"}],"variables":["base","index"],"precedence_tree":"(+ base (* index 4))","precedence":["parentheses","** (right associative)","unary - and ~","* / // % rem","+ -","<< >>","&","^","|"]}},{"input":{"expression":"-2 ** 3"},"output":{"standard_version":"Python 3.12 §6.5–6.9; ISO/IEC 9899:2018 §6.5.5","tokens":[{"type":"operator","text":"-"},{"type":"integer","text":"2"},{"type":"operator","text":"**"},{"type":"integer","text":"3"}],"variables":[],"precedence_tree":"(- (** 2 3))","precedence":["parentheses","** (right associative)","unary - and ~","* / // % rem","+ -","<< >>","&","^","|"]}}],"execute_url":"/v1/tools/integer-expression-parse/versions/1.0.0/execute"}