drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l

Source file repositories/reference/linux-study-clean/drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l

File Facts

System
Linux kernel
Corpus path
drivers/scsi/aic7xxx/aicasm/aicasm_macro_scan.l
Extension
.l
Size
4113 bytes
Lines
154
Domain
Driver Families
Bucket
drivers/scsi
Inferred role
Driver Families: drivers/scsi
Status
atlas-only

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (parren_count == 1) {
					string_buf_ptr = string_buf;
					return ('(');
				}
				*string_buf_ptr++ = '(';
			}
<ARGLIST>\)		{
				if (parren_count == 1) {
					if (string_buf_ptr != string_buf) {
						/*
						 * Return an argument and
						 * rescan this parren so we
						 * can return it as well.
						 */
						*string_buf_ptr = '\0';
						mmlval.str = string_buf;
						string_buf_ptr = string_buf;
						unput(')');
						return T_ARG;
					}
					BEGIN INITIAL;
					return (')');
				}
				parren_count--;
				*string_buf_ptr++ = ')';
			}
<ARGLIST>{MCARG}	{
				char *yptr;

				yptr = mmtext;
				while (*yptr)
					*string_buf_ptr++ = *yptr++;
			}
<ARGLIST>\,		{
				if (string_buf_ptr != string_buf) {
					/*
					 * Return an argument and
					 * rescan this comma so we
					 * can return it as well.
					 */
					*string_buf_ptr = '\0';
					mmlval.str = string_buf;
					string_buf_ptr = string_buf;
					unput(',');
					return T_ARG;
				}
				return ',';
			}
{WORD}[(]		{
				/* May be a symbol or a macro invocation. */
				mmlval.sym = symtable_get(mmtext);
				if (mmlval.sym->type != MACRO) {
					stop("Expecting Macro Name",
					     EX_DATAERR);
				}
				unput('(');
				parren_count = 0;
				BEGIN ARGLIST;
				return T_SYMBOL;
			}
.			{ 
				snprintf(buf, sizeof(buf), "Invalid character "
					 "'%c'", mmtext[0]);
				stop(buf, EX_DATAERR);
			}
%%

int
mmwrap()
{

Annotation

Implementation Notes