260 likes | 348 Views
Language for Array Data Processing. Team #6 Date:03/02/2010. TEAM. Haritha Rani Jadcherla Vikram Sriram Saloti Annapurna Venkat Narasimha. MENTORS Dr. Yue Kwon Mr. Ravi Ganta. AGENDA. Introduction Background Requirement Abstract Language specification Tool used (ANTLR) Demo
E N D
Language for Array Data Processing Team #6 Date:03/02/2010
TEAM HarithaRaniJadcherla VikramSriram Saloti Annapurna VenkatNarasimha MENTORS Dr. Yue Kwon Mr. Ravi Ganta
AGENDA • Introduction • Background • Requirement • Abstract • Language specification • Tool used (ANTLR) • Demo • Future work • References
Background • Traditional way of calculations • Decimal values • Paper work • Preciseness of results
Requirements • User friendly • Accuracy Software Requirements • Tool • Antlr • Microsoft Visual Studios • Operating system • Windows XP or any later version
Abstract • Problem • Difficulty in performing operations on arrays of data manually • Matrices have Tags • Solution • Designing an interpreter that works on the user friendly Domain Specific language generated • Developing a run time environment for the physicians to perform operations • Approach • language specification • Un ambiguous grammar • Generating Lexer and Parser using an automated tool (ANTLR) • Developing a Run Time environment
Abstract • Evaluation • User friendly to perform various mathematical operations on double data • Accuracy • Time
Language Specification • Only 4 Matrices. • Up to 7 tags • Types in MedCheck • Operations on matrices • Arithmetic Operations • Relational Operations • Logical Operations
Types in MedCheck There are basically two kinds of type: • Scalar Types: Integer, Double, Boolean, String • Vector Types: List and Matrix
Different ways to access matrix values • Matrix Name [r,c]; Example: M1[2,4]; • Matrix Name[{r1,r2},{c1,c2,c3}]; Example: M1[{1,3},{2,4,6}]; • Matrix Name[{rn..rm},{cx..cy}]; Example: M1[{1..3},{2..5}] • Matrix Name[*,*]; Example: M1[*,*];
Access to matrix cont.. • Matrix Name[*,c]; Example: M1[*,4]; • Matrix Name[r,*]; Example: M2[1,*];
Operations: Arithmetic • Addition and subtraction • Multiplication • Division • Addition and subtraction with a scalar • Multiplication and division by scalar
Operations: Relational And Logical • No relational operations on matrices but on elements of matrices • No Logical operations on matrices but on elements of matrices
Search expression • Matrix Name<’@ condition(s) ‘> Example: M1<’@value==3’>
Language Specification • Types of expressions • Arithmetic Expressions • Relational Expressions • Logical Expressions
Arithmetic Expressions • Addition and Subtraction • Multiplication • Division • Addition and Subtraction with a scalar • Multiplication and Division by Scalar
Relational and Logical Expressions • No relational operations on matrices but on elements of matrices • No Logical operations on matrices but on elements of matrices
Different Ways to Access Matrix values • Matrix Name [r,c]; • Matrix Name[{r1,r2,r3},{c1,c2,c3}]; • Matrix Name[{rn..rm},{cx..cy}]; where rn..rm=cx..cy • Matrix Name[*,*]; • Matrix Name[*,c]; • Matrix Name[r,*];
Functions • Types of Arguments: • Scalar values i.e., double. • Array where the first element represents row index and the second element represents column index. • Array where the first element is represented by * meaning it takes all the values in that row, and the corresponding element represents column index and vice versa. • By accessing the tag value available from the cell location.
Functions • Various functions used are: • Average, Minimum, Maximum, Sin, Cos, Tan, Median, Standard Deviation, %CV, Sort, Log10, Exp, X^y(a,b) • Note: Sort, Log10, Exp, X^y(a,b), Sin, Cos and Tan functions does not accept set type of data in arguments.
Tags • Three properties of Tag: • Tag Name • Tag Value • Tag Content • Tag Name: Represents the name of the tag by means of which we can access a tag. • Tag Value: Represents the Value of the tag which the particular tag holds. • Tag content describes the content in the tag.
Tags (Contd…) • Tag Creation: • The command that is used for creating new tag at user- prompt is as follows: • M1.ATTRIBUTE+=ID; • Assigning the tag value: • Tag value can be assigned directly at user-prompt as following: • M1.Tagname= value; • Deleting a tag: • The command that is used for deleting tags is as follows: • M1.ATTRIBUTE-=ID;
Conclusion • Design an interpreter • Appropriate error reporting • Exception handling • The language is user friendly • Help commands
References • http://www.antlr.org/wiki/pages/viewpage.action?pageId=557075 • http://www.antlr.org/wiki/display/ANTLR3/Antlr+3+CSharp+Target#Antlr3CSharpTarget-GettingStarted • http://www.antlr.org/wiki/display/ANTLR3/Five+minute+introduction+to+ANTLR+3 • http://www.antlr.org