{"record":{"id":"e5d8845649aed7fb","repo":"openjdk/jdk","slug":"s-found-d-syntax-error","errorCode":null,"errorMessage":"%s:  Found %d syntax error","messagePattern":"(.+?):  Found (.+?) syntax error","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hotspot/share/adlc/adlparse.cpp","lineNumber":63,"sourceCode":"//------------------------------~ADLParser-------------------------------------\n// Delete an ADL parser.\nADLParser::~ADLParser() {\n  if (!_AD._quiet_mode)\n    fprintf(stderr,\"---------------------------- Errors and Warnings ----------------------------\\n\");\n#ifndef ASSERT\n  if (!_AD._quiet_mode) {\n    fprintf(stderr, \"**************************************************************\\n\");\n    fprintf(stderr, \"***** WARNING: ASSERT is undefined, assertions disabled. *****\\n\");\n    fprintf(stderr, \"**************************************************************\\n\");\n  }\n#endif\n  if( _AD._syntax_errs + _AD._semantic_errs + _AD._warnings == 0 ) {\n    if (!_AD._quiet_mode)\n      fprintf(stderr,\"No errors or warnings to report from phase-1 parse.\\n\" );\n  }\n  else {\n    if( _AD._syntax_errs ) {      // Any syntax errors?\n      fprintf(stderr,\"%s:  Found %d syntax error\", _buf._fp->_name, _AD._syntax_errs);\n      if( _AD._syntax_errs > 1 ) fprintf(stderr,\"s.\\n\\n\");\n      else fprintf(stderr,\".\\n\\n\");\n    }\n    if( _AD._semantic_errs ) {    // Any semantic errors?\n      fprintf(stderr,\"%s:  Found %d semantic error\", _buf._fp->_name, _AD._semantic_errs);\n      if( _AD._semantic_errs > 1 ) fprintf(stderr,\"s.\\n\\n\");\n      else fprintf(stderr,\".\\n\\n\");\n    }\n    if( _AD._warnings ) {         // Any warnings?\n      fprintf(stderr,\"%s:  Found %d warning\", _buf._fp->_name, _AD._warnings);\n      if( _AD._warnings > 1 ) fprintf(stderr,\"s.\\n\\n\");\n      else fprintf(stderr,\".\\n\\n\");\n    }\n  }\n  if (!_AD._quiet_mode)\n    fprintf(stderr,\"-----------------------------------------------------------------------------\\n\");\n  _AD._TotalLines += linenum()-1;     // -1 for overshoot in \"nextline\" routine\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/hotspot/share/adlc/adlparse.cpp#L45-L81","documentation":"Not a thrown error: a phase-1 parse summary that ADLC prints to stderr when _AD._syntax_errs > 0 after parsing a .ad file — '\"%s: Found %d syntax error(s).\"' with the input file name and count. It means the ADL grammar was violated; the generated output must not be trusted (see _AD._no_output) even though ADLC may continue to completion.","triggerScenarios":"Any ADL grammar violation in a cpu/*/*.ad file: missing ';', unbalanced parentheses in match rules, bad ident characters, stray tokens after a definition. ADLParser::parse() increments _AD._syntax_errs via parse_err/sync and this report runs at the end of phase-1 parsing.","commonSituations":"Hand-editing .ad files to add instructions/operands; porting .ad files between HotSpot versions where the grammar changed; merge conflicts resolved incorrectly in .ad files.","solutions":["Scroll up in the build log: each individual syntax error was printed earlier with file/line context","Fix the reported lines (usually a missing ';', '}', or unbalanced parenthesis)","Diff your .ad change against a known-good revision to spot the typo","Rerun 'make adlc' or the full build to confirm zero errors"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# quick grammar sanity before full build: parentheses balanced per rule\nawk '{o+=gsub(/\\(/,\"(\"); c+=gsub(/\\)/,\")\")} END { if (o!=c) { print \"unbalanced parens\"; exit 1 } }' src/hotspot/cpu/x86/x86.ad","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run adlc standalone on the edited .ad before the full build","Keep .ad edits small and rebuild incrementally","Check build log above the summary for the exact error lines"],"tags":["adlc","syntax-error","build","hotspot","parser"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}