Cards Text Grammar
Moderators: silly freak, CCGHQ Admins
Cards Text Grammar
by silly freak » 09 Sep 2010, 12:48
This is a list of the possibilities of the "text" line in card files:
General Grammar
General Grammar
- Code: Select all
Text:
Effects
ActivatedAbility
TriggeredAbility
ActivatedAbility:
Costs ":" Effects
TriggeredAbility:
Trigger "," Effects
Costs:
Cost
Cost "," Costs
Effects:
Effect "."
Effect Effects
- Code: Select all
Cost:
ManaSequence
"{T}"
"{Q}"
"Sacrifice ~"
Effect:
"Add" ManaSequence "to your mana pool"
"Draw a card" | "Draw" Number "cards"
"~ deals" Number "damage to all creatures"
"Destroy all creatures" ". They can't be regenerated"?
Trigger:
"When ~ enters the battlefield"
- Code: Select all
Effect:
"You gain" Number "life"
- Code: Select all
Example Regex actually used
"You" "[Yy]ou"
"you" "you"
- Code: Select all
Trigger "," Effects
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
Re: Cards Text Grammar
by nantuko84 » 09 Sep 2010, 19:01
Have you tried ANTLR?
It generates lexer and parser with built-in constructions bases on grammar written in format very similar to BNF (Backus Normal Form).
It generates lexer and parser with built-in constructions bases on grammar written in format very similar to BNF (Backus Normal Form).
Mage\MagicWars blog: http://mwars.blogspot.com/
Re: Cards Text Grammar
by silly freak » 09 Sep 2010, 19:27
I have heard (and read in your blog) of it, but not yet tried it. I played with DSLs in Scala, and will probably use ANTLR at some point.
___
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
- silly freak
- DEVELOPER
- Posts: 598
- Joined: 26 Mar 2009, 07:18
- Location: Vienna, Austria
- Has thanked: 93 times
- Been thanked: 25 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest