You want to use an "Optional Expression" (see about 60% down on this page):
grammar Sokmesa
rule line
"system" wsp+ marker wsp+ (category wsp+)? attributelist
end
rule category
"AAA1" # Or whatever
end
# Add rules for 'marker', 'wsp', and 'attributelist' here
end