paranthesis_matching.cpp File Reference

Perform paranthesis matching. More...

`#include <iostream>`
`#include <cstring>`
Include dependency graph for paranthesis_matching.cpp:

## Macros

#define | MAX 100

## Functions

char | opening (char ch)
int | main ()
char | stack [MAX]
int | stack_idx = -1
| pointer to track stack index
void | push (char ch)
| push byte to stack variable
char | pop ()
| pop a byte out of stack variable

## Detailed Description

Perform paranthesis matching.

Note
  Do not know the application of this, however.
  Implementation is C-type and does not utilize the C++ constructs

Todo:
  implement as a C++ class

## Macro Definition Documentation

## MAX

#define MAX 100

check number

## Function Documentation

## opening()

char opening | ( | char | ch | ) |

return opening paranthesis corresponding to the close paranthesis

Parameters

  [in] | ch | closed paranthesis character

{
switch (ch) {
case '}':
return '{';
case ']':
return '[';
case ')':
return '(';
case '>':
return '<';
}
return '\0';
}

## Variable Documentation

## stack

char stack[MAX]

-----------— stack -----------— global stack