[Newcompiler] SmaCC error when compiling parser

math su mathieusuen at yahoo.fr
Tue Jul 18 21:39:22 UTC 2006


Hi,

I was writing rules for apicall and cdecl primitive and I have the
following error when I compile the parser:

==================================================
VM: Win32 - a SmalltalkImage
Image: Squeak3.9alpha [latest update: #7045]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir D:\Dev\Smalltalk\Squeak\3.9_7046
Trusted Dir D:\Dev\Smalltalk\Squeak\3.9_7046\SUEN
Untrusted Dir C:\My Squeak\SUEN

DependentsArray(Object)>>error:
	Receiver: a DependentsArray(<keyword> "}" "]" ")" <name> <period> E O F
<binarySymbol> <keyword> "}"...etc...
	Arguments and temporary variables:
		aString: 	'subscript is out of bounds: 25'
	Receiver's instance variables:
a DependentsArray(<keyword> "}" "]" ")" <name> <period> E O F
<binarySymbol> <keyword> "}"...etc...

DependentsArray(Object)>>errorSubscriptBounds:
	Receiver: a DependentsArray(<keyword> "}" "]" ")" <name> <period> E O F
<binarySymbol> <keyword> "}"...etc...
	Arguments and temporary variables:
		index: 	25
	Receiver's instance variables:
a DependentsArray(<keyword> "}" "]" ")" <name> <period> E O F
<binarySymbol> <keyword> "}"...etc...

DependentsArray(Object)>>at:put:
	Receiver: a DependentsArray(<keyword> "}" "]" ")" <name> <period> E O F
<binarySymbol> <keyword> "}"...etc...
	Arguments and temporary variables:
		index: 	25
		value: 	<keyword> "}" "]" ")" <name> <period> E O F <binarySymbol>
	Receiver's instance variables:
a DependentsArray(<keyword> "}" "]" ")" <name> <period> E O F
<binarySymbol> <keyword> "}"...etc...

WriteStream>>pastEndPut:
	Receiver: <<error during printing>>
	Arguments and temporary variables:
		anObject: 	<keyword> "}" "]" ")" <name> <period> E O F <binarySymbol>
		oldSize: 	4
		grownCollection: 	a DependentsArray(<keyword> "}" "]" ")" <name>
<period> E O F ...etc...
	Receiver's instance variables:
		collection: 	a DependentsArray(<keyword> "}" "]" ")" <name> <period> E
O F <bina...etc...
		position: 	25
		readLimit: 	25
		writeLimit: 	3


--- The full stack ---
DependentsArray(Object)>>error:
DependentsArray(Object)>>errorSubscriptBounds:
DependentsArray(Object)>>at:put:
WriteStream>>pastEndPut:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WriteStream>>nextPut:
[] in DependentsArray>>copyWith: {[:item | s nextPut: item]}
DependentsArray>>do:
[] in DependentsArray>>copyWith: {[:s |  self   do: [:item | s nextPut:
item].  s nextPut: newElement]}
DependentsArray class(SequenceableCollection class)>>streamContents:
DependentsArray>>copyWith:
DependentsArray(Array)>>copyWithDependent:
SmaCCSymbolSet(Object)>>addDependent:
SmaCCSymbolSet>>addComponent:
SmaCCSymbolSet>>baseOn:
SmaCCSymbolSet class>>basedOn:
SmaCCLR1Item>>moveNext
[] in SmaCCItemSet>>moveOn: {[:each | each nextSymbol == aGrammarSymbol
  ifTrue: [anItemSet add: each mo...]}
SmaCCItemSet(Set)>>do:
SmaCCItemSet>>moveOn:
[] in SmaCCGrammarCompiler>>createItemSets {[:each |  newState :=
itemSet moveOn: each.  newState notEmpty   ifTrue: [sh...]}
SortedCollection(OrderedCollection)>>do:
SmaCCGrammarCompiler>>createItemSets
SmaCCGrammarCompiler>>transitionTable
SmaCCGrammarCompiler>>compileTransitionTable
SmaCCGrammarCompiler>>compileParser
SmaCCGrammarCompiler>>createChanges
[] in SmaCCParserGenerator>>compile: {[parserCompiler createChanges.
self generateDefinitionComments   ifTrue: [p...]}
BlockContext>>on:do:
[] in SmaCCParserGenerator>>compile: {[SmaCCGrammar ignoreCase: self
ignoreCase;    maximumCharacterValue: 255.  p...]}
BlockContext>>ensure:
[] in SmaCCParserGenerator>>compile: {[oldIgnoreCase := SmaCCGrammar
ignoreCase.  oldCharacterSize := SmaCCGrammar...]}
BlockContext>>ensure:
CursorWithMask(Cursor)>>showWhile:
SmaCCParserGenerator>>compile:
SmaCCParserGenerator>>compileLALR1
PluggableButtonMorph>>performAction
[] in PluggableButtonMorph>>mouseUp: {[:m | (m containsPoint: evt
cursorPoint)   ifTrue: [m performAction]]}
Array(SequenceableCollection)>>do:
PluggableButtonMorph>>mouseUp:
PluggableButtonMorph(Morph)>>handleMouseUp:
MouseButtonEvent>>sentTo:
PluggableButtonMorph(Morph)>>handleEvent:
PluggableButtonMorph(Morph)>>handleFocusEvent:
[] in HandMorph>>sendFocusEvent:to:clear: {[ActiveHand := self.
ActiveEvent := anEvent.  result := focusHolder     han...]}
[] in PasteUpMorph>>becomeActiveDuring: {[aBlock value]}
BlockContext>>on:do:
PasteUpMorph>>becomeActiveDuring:
HandMorph>>sendFocusEvent:to:clear:
HandMorph>>sendEvent:focus:clear:
HandMorph>>sendMouseEvent:

==================================================


So I think is beceause my grammar are to long (to mush or) so I separate
some rules but nothing change:


===================Grammar=========================
...

PragmaMessage:
	Message
|	Apicall;
	
Apicall:
	TypeCall ExternalType <string> "(" ParameterApicall ")" "module:" <string>;
	
TypeCall:
	"apicall:"
|	"cdecl:";
	
ExternalType:
	RawExternalType
|	PointerExternalType;

RawExternalType:
	ExternalTypePrim1			
|	ExternalTypePrim2
|	ExternalTypePrim3;
	
PointerExternalType:
	ExternalTypePrim1 "*"
|	ExternalTypePrim2 "*"
|	ExternalTypePrim3 "*";

ExternalTypePrim1:
	"bool"
| 	"void"
|	"byte"
|	"schar"
|	"double";
	
ExternalTypePrim2:
	"float"
|	"sbyte"
|	"char"
|	"ushort"
|	"short";
	
ExternalTypePrim3:
	"longlong"
|	"ulong"
|	"ulonglong"
|	"long";

	
ParameterApicall:
	ParamName
|	ParameterApicall ParamName;
	
ParamName:
	<name>
|	<name> "*";
===================Grammar=========================

So why? :)

Thanks
Math

	

	
		
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com


More information about the Newcompiler mailing list