|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
help,compiler errorhi guys i search a code from url http://langexplr.blogspot.com/2007/06/calling-boo-compiler-from-boo-program.html and i compiler it at sharpdevelop, it has two errors as follows 'Switch' is not a member of 'Boo.Lang.Compiler.Ast.Visitors.BooPrinterVisitor'. (BCE0019) - C: \Documents and Settings\Administrator\My Documents\SharpDevelop Projects\test\test\examples\ast.boo:34,36 'Not' is not a member of 'Boo.Lang.Compiler.Ast.UnaryOperatorType'. (BCE0019) - C:\Documents and Settings\Administrator\My Documents \SharpDevelop Projects\test\test\examples\ast.boo:37,68 detail: import Boo.Lang.Compiler.Ast import Boo.Lang.Compiler.Ast.Visitors import System def print(node as Node): BooPrinterVisitor(Console.Out).Switch def CreateNotExpression(e as Expression): return UnaryExpression(Operand: e, Operator: UnaryOperatorType.Not) e = ExpressionStatement( Expression: be = BinaryExpression(BinaryOperatorType.Assign, ReferenceExpression("a"), IntegerLiteralExpression(3) ) ) print(e) be.ParentNode.Replace(be, MethodInvocationExpression(Target: ReferenceExpression("a"))) print(e) i = IfStatement(Condition: be = BinaryExpression(BinaryOperatorType.NotMatch, StringLiteralExpression("foo"), StringLiteralExpression("bar"))) i.TrueBlock = Block() //be.ReplaceBy(CreateNotExpression(be)) //i.Expression = CreateNotExpression(be) i.Replace(be, CreateNotExpression(be)) be.Operator = BinaryOperatorType.Match print(i) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Boo Programming Language" group. To post to this group, send email to boolang@... To unsubscribe from this group, send email to boolang-unsubscribe@... For more options, visit this group at http://groups.google.com/group/boolang -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: help,compiler errormy boo version is 0.8.2.2960 On 7月3日, 下午8时44分, Eric <FREDERICK....@...> wrote: > hi guys > i search a code from urlhttp://langexplr.blogspot.com/2007/06/calling-boo-compiler-from-boo-p... > and i compiler it at sharpdevelop, > > it has two errors as follows > > 'Switch' is not a member of > 'Boo.Lang.Compiler.Ast.Visitors.BooPrinterVisitor'. (BCE0019) - C: > \Documents and Settings\Administrator\My Documents\SharpDevelop > Projects\test\test\examples\ast.boo:34,36 > 'Not' is not a member of 'Boo.Lang.Compiler.Ast.UnaryOperatorType'. > (BCE0019) - C:\Documents and Settings\Administrator\My Documents > \SharpDevelop Projects\test\test\examples\ast.boo:37,68 > > detail: > import Boo.Lang.Compiler.Ast > import Boo.Lang.Compiler.Ast.Visitors > import System > > def print(node as Node): > BooPrinterVisitor(Console.Out).Switch > > def CreateNotExpression(e as Expression): > return UnaryExpression(Operand: e, Operator: UnaryOperatorType.Not) > > e = ExpressionStatement( > Expression: be = BinaryExpression(BinaryOperatorType.Assign, > ReferenceExpression("a"), > IntegerLiteralExpression(3) > ) > ) > print(e) > > be.ParentNode.Replace(be, MethodInvocationExpression(Target: > ReferenceExpression("a"))) > print(e) > > i = IfStatement(Condition: be = > BinaryExpression(BinaryOperatorType.NotMatch, > StringLiteralExpression("foo"), > StringLiteralExpression("bar"))) > i.TrueBlock = Block() > //be.ReplaceBy(CreateNotExpression(be)) > //i.Expression = CreateNotExpression(be) > i.Replace(be, CreateNotExpression(be)) > > be.Operator = BinaryOperatorType.Match > print(i) You received this message because you are subscribed to the Google Groups "Boo Programming Language" group. To post to this group, send email to boolang@... To unsubscribe from this group, send email to boolang-unsubscribe@... For more options, visit this group at http://groups.google.com/group/boolang -~----------~----~----~----~------~----~------~--~--- |
|
|
Re: help,compiler errorHere your issue is that "Switch" isn't a member of the
BooPrinterVisitor, and the operator type you are looking for is not "Not", but "LogicalNot". Reflector or the source are good points of information for this type of thing. Marcus Eric wrote: > hi guys > i search a code from url > http://langexplr.blogspot.com/2007/06/calling-boo-compiler-from-boo-program.html > and i compiler it at sharpdevelop, > > it has two errors as follows > > 'Switch' is not a member of > 'Boo.Lang.Compiler.Ast.Visitors.BooPrinterVisitor'. (BCE0019) - C: > \Documents and Settings\Administrator\My Documents\SharpDevelop > Projects\test\test\examples\ast.boo:34,36 > 'Not' is not a member of 'Boo.Lang.Compiler.Ast.UnaryOperatorType'. > (BCE0019) - C:\Documents and Settings\Administrator\My Documents > \SharpDevelop Projects\test\test\examples\ast.boo:37,68 > > > detail: > import Boo.Lang.Compiler.Ast > import Boo.Lang.Compiler.Ast.Visitors > import System > > def print(node as Node): > BooPrinterVisitor(Console.Out).Switch > > def CreateNotExpression(e as Expression): > return UnaryExpression(Operand: e, Operator: UnaryOperatorType.Not) > > e = ExpressionStatement( > Expression: be = BinaryExpression(BinaryOperatorType.Assign, > ReferenceExpression("a"), > IntegerLiteralExpression(3) > ) > ) > print(e) > > be.ParentNode.Replace(be, MethodInvocationExpression(Target: > ReferenceExpression("a"))) > print(e) > > > i = IfStatement(Condition: be = > BinaryExpression(BinaryOperatorType.NotMatch, > StringLiteralExpression("foo"), > StringLiteralExpression("bar"))) > i.TrueBlock = Block() > //be.ReplaceBy(CreateNotExpression(be)) > //i.Expression = CreateNotExpression(be) > i.Replace(be, CreateNotExpression(be)) > > be.Operator = BinaryOperatorType.Match > print(i) > > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups "Boo Programming Language" group. > To post to this group, send email to boolang@... > To unsubscribe from this group, send email to boolang-unsubscribe@... > For more options, visit this group at http://groups.google.com/group/boolang > -~----------~----~----~----~------~----~------~--~--- > > Marcus Griep GPG Key ID: 0x5E968152 —— http://www.boohaunt.net את.ψο´ |
| Free Forum Powered by Nabble | Forum Help |